| Index: Source/platform/graphics/ImageBufferSurface.h
|
| diff --git a/Source/platform/graphics/skia/GaneshUtils.h b/Source/platform/graphics/ImageBufferSurface.h
|
| similarity index 58%
|
| copy from Source/platform/graphics/skia/GaneshUtils.h
|
| copy to Source/platform/graphics/ImageBufferSurface.h
|
| index bc4c0cb6dae4f16484a510c29db5f98cc86045b3..a415cfa9e1877604fc84300c186dc94b196d4591 100644
|
| --- a/Source/platform/graphics/skia/GaneshUtils.h
|
| +++ b/Source/platform/graphics/ImageBufferSurface.h
|
| @@ -28,18 +28,56 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -#ifndef GaneshUtils_h
|
| -#define GaneshUtils_h
|
| +#ifndef ImageBufferSurface_h
|
| +#define ImageBufferSurface_h
|
|
|
| #include "platform/PlatformExport.h"
|
| #include "platform/geometry/IntSize.h"
|
| -#include "third_party/skia/include/core/SkBitmap.h"
|
| -#include "third_party/skia/include/gpu/GrContext.h"
|
| +#include "platform/graphics/GraphicsTypes3D.h"
|
| +#include "wtf/FastAllocBase.h"
|
| +#include "wtf/Noncopyable.h"
|
| +
|
| +class SkCanvas;
|
| +class SkBitmap;
|
| +
|
| +namespace blink { class WebLayer; }
|
|
|
| namespace WebCore {
|
|
|
| -bool PLATFORM_EXPORT ensureTextureBackedSkBitmap(GrContext*, SkBitmap&, const IntSize&, GrSurfaceOrigin, GrPixelConfig);
|
| +enum OpacityMode {
|
| + NonOpaque,
|
| + Opaque,
|
| +};
|
| +
|
| +class PLATFORM_EXPORT ImageBufferSurface {
|
| + WTF_MAKE_NONCOPYABLE(ImageBufferSurface); WTF_MAKE_FAST_ALLOCATED;
|
| +public:
|
| + virtual ~ImageBufferSurface() { }
|
| +
|
| + virtual SkCanvas* canvas() const = 0;
|
| + virtual const SkBitmap& bitmap() const;
|
| + virtual void willUse() { } // Called by ImageBuffer before reading or writing to the surface.
|
| + virtual bool isValid() const = 0;
|
| + virtual blink::WebLayer* layer() const { return 0; };
|
| + virtual bool isAccelerated() const { return false; }
|
| + virtual Platform3DObject getBackingTexture() const { return 0; }
|
| +
|
| + OpacityMode opacityMode() const { return m_opacityMode; }
|
| + const IntSize& size() const { return m_size; }
|
| +
|
| +protected:
|
| + void clear();
|
| +
|
| + ImageBufferSurface(const IntSize& size, OpacityMode opacityMode)
|
| + : m_opacityMode(opacityMode)
|
| + , m_size(size)
|
| + { }
|
| +
|
| +private:
|
| + OpacityMode m_opacityMode;
|
| + IntSize m_size;
|
| +};
|
|
|
| } // namespace WebCore
|
|
|
| -#endif // GaneshUtils_h
|
| +#endif
|
|
|