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

Unified Diff: Source/core/platform/graphics/gpu/NonDrawableAcceleratedImageBufferSurface.h

Issue 104023007: Refactoring ImageBuffer to decouple it from Canvas2DLayerBridge (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: build fixes for win+mac 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/core/platform/graphics/gpu/NonDrawableAcceleratedImageBufferSurface.h
diff --git a/Source/core/platform/graphics/GaneshUtils.h b/Source/core/platform/graphics/gpu/NonDrawableAcceleratedImageBufferSurface.h
similarity index 63%
copy from Source/core/platform/graphics/GaneshUtils.h
copy to Source/core/platform/graphics/gpu/NonDrawableAcceleratedImageBufferSurface.h
index a86b0efb597435880efd77b9d991c2fa102fd756..c74bbb3e143366590b4b3006e74bdda99b21eb4f 100644
--- a/Source/core/platform/graphics/GaneshUtils.h
+++ b/Source/core/platform/graphics/gpu/NonDrawableAcceleratedImageBufferSurface.h
@@ -28,17 +28,32 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef GaneshUtils_h
-#define GaneshUtils_h
+#ifndef NonDrawableAcceleratedImageBufferSurface_h
+#define NonDrawableAcceleratedImageBufferSurface_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 ensureTextureBackedSkBitmap(GrContext*, SkBitmap&, const IntSize&, GrSurfaceOrigin, GrPixelConfig);
+// This is a GPU backed surface that has no canvas or render target.
+class NonDrawableAcceleratedImageBufferSurface : public ImageBufferSurface {
+ WTF_MAKE_NONCOPYABLE(NonDrawableAcceleratedImageBufferSurface); WTF_MAKE_FAST_ALLOCATED;
+public:
+ NonDrawableAcceleratedImageBufferSurface(const IntSize&, OpacityMode = NonOpaque, float resolutionScale = 1.0f);
+ virtual ~NonDrawableAcceleratedImageBufferSurface() { }
+
+ 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