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

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

Issue 588403003: Fix a rendering bug when frames have no dirty rect on display list mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rename Created 6 years, 3 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/RecordingImageBufferSurface.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/RecordingImageBufferSurface.cpp
diff --git a/Source/platform/graphics/RecordingImageBufferSurface.cpp b/Source/platform/graphics/RecordingImageBufferSurface.cpp
index 1b445dcd6938e17956cd91bc9e525a3940741fe4..1d57c614d757a1b03d61de4176e118b9217be992 100644
--- a/Source/platform/graphics/RecordingImageBufferSurface.cpp
+++ b/Source/platform/graphics/RecordingImageBufferSurface.cpp
@@ -28,8 +28,16 @@ RecordingImageBufferSurface::RecordingImageBufferSurface(const IntSize& size, Op
RecordingImageBufferSurface::~RecordingImageBufferSurface()
{ }
-void RecordingImageBufferSurface::initializeCurrentFrame()
+bool RecordingImageBufferSurface::initializeCurrentFrame()
{
+ StateStack stateStack;
+ bool saved = false;
+ if (m_currentFrame) {
+ saved = saveState(m_currentFrame->getRecordingCanvas(), &stateStack);
+ if (!saved)
+ return false;
+ }
+
static SkRTreeFactory rTreeFactory;
m_currentFrame = adoptPtr(new SkPictureRecorder);
m_currentFrame->beginRecording(size().width(), size().height(), &rTreeFactory);
@@ -38,6 +46,11 @@ void RecordingImageBufferSurface::initializeCurrentFrame()
m_imageBuffer->context()->resetCanvas(m_currentFrame->getRecordingCanvas());
m_imageBuffer->context()->setRegionTrackingMode(GraphicsContext::RegionTrackingOverwrite);
}
+
+ if (saved)
+ setCurrentState(m_currentFrame->getRecordingCanvas(), &stateStack);
+
+ return true;
}
void RecordingImageBufferSurface::setImageBuffer(ImageBuffer* imageBuffer)
@@ -134,16 +147,10 @@ bool RecordingImageBufferSurface::finalizeFrameInternal()
return false;
}
- StateStack stateStack;
-
- if (!saveState(m_currentFrame->getRecordingCanvas(), &stateStack)) {
- return false;
- }
-
m_previousFrame = adoptRef(m_currentFrame->endRecording());
- initializeCurrentFrame();
+ if (!initializeCurrentFrame())
+ return false;
- setCurrentState(m_currentFrame->getRecordingCanvas(), &stateStack);
m_frameWasCleared = false;
return true;
« no previous file with comments | « Source/platform/graphics/RecordingImageBufferSurface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698