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

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

Issue 1288773005: 2D canvas: remain in deferred rendering mode with canvas to canvas drawImage (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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
« no previous file with comments | « Source/platform/graphics/ImageBuffer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/ImageBuffer.cpp
diff --git a/Source/platform/graphics/ImageBuffer.cpp b/Source/platform/graphics/ImageBuffer.cpp
index 12a631e173a4618d5632b44681869de5f3be4717..095d86452f6e366e820cac887ebb6375eaa55d07 100644
--- a/Source/platform/graphics/ImageBuffer.cpp
+++ b/Source/platform/graphics/ImageBuffer.cpp
@@ -149,6 +149,9 @@ void ImageBuffer::resetCanvas(SkCanvas* canvas) const
PassRefPtr<SkImage> ImageBuffer::newSkImageSnapshot() const
{
+ if (m_animationState == InitialAnimationState)
+ m_animationState = DidAcquireSnapshot;
Stephen White 2015/08/17 15:15:07 Naming nit: m_drawnToAfterSnapshot or something li
+
if (!isSurfaceValid())
return nullptr;
return m_surface->newImageSnapshot();
@@ -156,14 +159,19 @@ PassRefPtr<SkImage> ImageBuffer::newSkImageSnapshot() const
PassRefPtr<Image> ImageBuffer::newImageSnapshot() const
{
- if (!isSurfaceValid())
- return nullptr;
- RefPtr<SkImage> snapshot = m_surface->newImageSnapshot();
+ RefPtr<SkImage> snapshot = newSkImageSnapshot();
if (!snapshot)
return nullptr;
return StaticBitmapImage::create(snapshot);
}
+void ImageBuffer::didDraw(const FloatRect& rect) const
+{
+ if (m_animationState == DidAcquireSnapshot)
+ m_animationState = DidDrawAfterSnapshot;
+ m_surface->didDraw(rect);
+}
+
WebLayer* ImageBuffer::platformLayer() const
{
return m_surface->layer();
« no previous file with comments | « Source/platform/graphics/ImageBuffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698