view modules/web/src/main/native/Source/WebCore/platform/graphics/java/BufferImageJava.h @ 5976:94331ac42150

RT-25869: Update copyright year in header of modified source code files to 2013 Reviewed-by: Mong Hang Vo
author kcr
date Mon, 23 Dec 2013 13:46:39 -0800
parents 8cbaf9096cda
line wrap: on
line source
 * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
#ifndef BufferImageJava_h
#define BufferImageJava_h

#include "GraphicsContext.h"
#include "Image.h"
#include "IntSize.h"
#include "JavaEnv.h"

namespace WebCore {

//BufferImage is an image renderer. That provides the functionality
//of canvas buffer drawing.

class BufferImage : public Image {
    static PassRefPtr<BufferImage> create(
        PassRefPtr<RQRef> rqoImage,
        PassRefPtr<RenderingQueue> rq,
        int w, int h)
        return adoptRef(new BufferImage(rqoImage, rq, w, h));

    virtual void destroyDecodedData(bool destroyAll = true) { }
    virtual unsigned decodedSize() const { return 0; }

    //utatodo: callback to Java
    virtual bool currentFrameKnownToBeOpaque() { return false; /*!m_data->m_bitmap->hasAlpha() ;*/}

    virtual IntSize size() const { return IntSize(m_width, m_height); }

    virtual void draw(GraphicsContext* gc, const FloatRect& dstRect,
                      const FloatRect& srcRect, ColorSpace styleColorSpace,
                      CompositeOperator op, BlendMode bm);

    virtual void drawPattern(GraphicsContext* gc, const FloatRect& srcRect, const AffineTransform& patternTransform,
                             const FloatPoint& phase, ColorSpace styleColorSpace, CompositeOperator, const FloatRect& destRect);

    virtual NativeImagePtr nativeImageForCurrentFrame();

    BufferImage(PassRefPtr<RQRef> rqoImage, PassRefPtr<RenderingQueue> rq, int w, int h);

    void flushImageRQ(GraphicsContext *gc);

    int m_width, m_height;
    RefPtr<RQRef> m_rqoImage;
    RefPtr<RenderingQueue> m_rq;