Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Unified Diff: Source/platform/graphics/ImageBufferSurface.h

Issue 104023007: Refactoring ImageBuffer to decouple it from Canvas2DLayerBridge (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase mayhem Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/graphics/ImageBuffer.cpp ('k') | Source/platform/graphics/ImageBufferSurface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/platform/graphics/ImageBuffer.cpp ('k') | Source/platform/graphics/ImageBufferSurface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698