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

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

Issue 379253002: Initial implementation of display list backed 2D canvases (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: applied review comments Created 6 years, 5 months 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/ImageBufferSurface.cpp
diff --git a/Source/platform/graphics/ImageBufferSurface.cpp b/Source/platform/graphics/ImageBufferSurface.cpp
index 2869f4cc29ae5a05d3d2daffbcf23b52930bd775..1d1971021de1b41baf742b284725f362237590f9 100644
--- a/Source/platform/graphics/ImageBufferSurface.cpp
+++ b/Source/platform/graphics/ImageBufferSurface.cpp
@@ -35,6 +35,7 @@
#include "platform/graphics/ImageBuffer.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkDevice.h"
+#include "third_party/skia/include/core/SkPicture.h"
namespace WebCore {
@@ -45,6 +46,14 @@ ImageBufferSurface::ImageBufferSurface(const IntSize& size, OpacityMode opacityM
setIsHidden(false);
}
+ImageBufferSurface::~ImageBufferSurface()
+{ }
+
+PassRefPtr<SkPicture> ImageBufferSurface::getPicture()
+{
+ return nullptr;
+}
+
void ImageBufferSurface::clear()
{
// Clear the background transparent or opaque, as required. It would be nice if this wasn't
@@ -55,12 +64,13 @@ void ImageBufferSurface::clear()
canvas()->drawARGB(255, 0, 0, 0, SkXfermode::kSrc_Mode);
else
canvas()->drawARGB(0, 0, 0, 0, SkXfermode::kClear_Mode);
+ didClearCanvas();
}
}
-const SkBitmap& ImageBufferSurface::bitmap() const
+const SkBitmap& ImageBufferSurface::bitmap()
{
- ASSERT(canvas());
+ willReadback();
return canvas()->getTopDevice()->accessBitmap(false);
}

Powered by Google App Engine
This is Rietveld 408576698