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

Unified Diff: Source/platform/graphics/gpu/WebGLImageBufferSurface.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
Index: Source/platform/graphics/gpu/WebGLImageBufferSurface.h
diff --git a/Source/platform/graphics/skia/GaneshUtils.h b/Source/platform/graphics/gpu/WebGLImageBufferSurface.h
similarity index 66%
copy from Source/platform/graphics/skia/GaneshUtils.h
copy to Source/platform/graphics/gpu/WebGLImageBufferSurface.h
index bc4c0cb6dae4f16484a510c29db5f98cc86045b3..0725ff271e2cc5f4f27e58e1c3832a1560b1441b 100644
--- a/Source/platform/graphics/skia/GaneshUtils.h
+++ b/Source/platform/graphics/gpu/WebGLImageBufferSurface.h
@@ -28,18 +28,32 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef GaneshUtils_h
-#define GaneshUtils_h
+#ifndef WebGLImageBufferSurface_h
+#define WebGLImageBufferSurface_h
-#include "platform/PlatformExport.h"
-#include "platform/geometry/IntSize.h"
+#include "platform/graphics/ImageBufferSurface.h"
#include "third_party/skia/include/core/SkBitmap.h"
-#include "third_party/skia/include/gpu/GrContext.h"
namespace WebCore {
-bool PLATFORM_EXPORT ensureTextureBackedSkBitmap(GrContext*, SkBitmap&, const IntSize&, GrSurfaceOrigin, GrPixelConfig);
+// This is a GPU backed surface that has no canvas or render target.
+class PLATFORM_EXPORT WebGLImageBufferSurface : public ImageBufferSurface {
+ WTF_MAKE_NONCOPYABLE(WebGLImageBufferSurface); WTF_MAKE_FAST_ALLOCATED;
+public:
+ WebGLImageBufferSurface(const IntSize&, OpacityMode = NonOpaque);
+ virtual ~WebGLImageBufferSurface() { }
+
+ virtual SkCanvas* canvas() const OVERRIDE { return 0; }
+ virtual const SkBitmap& bitmap() const OVERRIDE { return m_bitmap; }
+ virtual bool isValid() const OVERRIDE { return m_bitmap.pixelRef(); }
+ virtual bool isAccelerated() const OVERRIDE { return true; }
+ virtual Platform3DObject getBackingTexture() const OVERRIDE;
+
+private:
+ SkBitmap m_bitmap;
+};
+
} // namespace WebCore
-#endif // GaneshUtils_h
+#endif

Powered by Google App Engine
This is Rietveld 408576698