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

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

Issue 661763003: Ensure canvas state is preserved when 2d canvas falls out of display list mode (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixup Created 6 years, 2 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 | « LayoutTests/fast/canvas/canvas-unbalanced-save-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/RecordingImageBufferSurface.cpp
diff --git a/Source/platform/graphics/RecordingImageBufferSurface.cpp b/Source/platform/graphics/RecordingImageBufferSurface.cpp
index db4c5594e0ef5653be38c9b4a2b6d248ab8bf8ac..c2575d3d5e5b0ac129e7a2781a8522142c862450 100644
--- a/Source/platform/graphics/RecordingImageBufferSurface.cpp
+++ b/Source/platform/graphics/RecordingImageBufferSurface.cpp
@@ -88,10 +88,16 @@ void RecordingImageBufferSurface::fallBackToRasterCanvas()
m_previousFrame->draw(m_fallbackSurface->canvas());
m_previousFrame.clear();
}
+
if (m_currentFrame) {
+ bool savedState = false;
+ StateStack stateStack;
+ savedState = saveState(m_currentFrame->getRecordingCanvas(), &stateStack);
RefPtr<SkPicture> currentPicture = adoptRef(m_currentFrame->endRecording());
currentPicture->draw(m_fallbackSurface->canvas());
m_currentFrame.clear();
+ if (savedState)
+ setCurrentState(m_fallbackSurface->canvas(), &stateStack);
}
if (m_imageBuffer) {
« no previous file with comments | « LayoutTests/fast/canvas/canvas-unbalanced-save-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698