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

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

Issue 358893002: Use newImageSnapshot() to get an image from a Canvas (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Bitmap caching for Shaders/Patterns from StaticBitmapImage/SkImage Created 6 years, 4 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/Canvas2DLayerBridge.cpp
diff --git a/Source/platform/graphics/Canvas2DLayerBridge.cpp b/Source/platform/graphics/Canvas2DLayerBridge.cpp
index 7d4dbdfeb5ffda1cedadb8ca768f5bef85f0379f..9798eaf66677877753f0ebcfc478f5e65b5e52dc 100644
--- a/Source/platform/graphics/Canvas2DLayerBridge.cpp
+++ b/Source/platform/graphics/Canvas2DLayerBridge.cpp
@@ -30,6 +30,7 @@
#include "GrContext.h"
#include "SkDevice.h"
#include "SkSurface.h"
+
#include "platform/TraceEvent.h"
#include "platform/graphics/Canvas2DLayerManager.h"
#include "platform/graphics/GraphicsLayer.h"
@@ -567,6 +568,11 @@ Platform3DObject Canvas2DLayerBridge::getBackingTexture()
return 0;
}
+PassRefPtr<SkImage> Canvas2DLayerBridge::newImageSnapshot()
+{
+ return adoptRef(m_canvas->newImageSnapshot());
+}
+
Canvas2DLayerBridge::MailboxInfo::MailboxInfo(const MailboxInfo& other) {
// This copy constructor should only be used for Vector reallocation
// Assuming 'other' is to be destroyed, we transfer m_image ownership

Powered by Google App Engine
This is Rietveld 408576698