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

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

Issue 1879133004: Allow fallbackFactory to be null in RecordingImageBufferSurface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 | « third_party/WebKit/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: third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurface.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurface.cpp b/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurface.cpp
index 669767a356675c692d6d65c5ecfa97557b909faf..08caf7615dc2e975b5e059e2bbc8f595220b0d9f 100644
--- a/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurface.cpp
+++ b/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurface.cpp
@@ -70,6 +70,8 @@ bool RecordingImageBufferSurface::writePixels(const SkImageInfo& origInfo, const
void RecordingImageBufferSurface::fallBackToRasterCanvas(FallbackReason reason)
{
+ ASSERT(m_fallbackFactory);
+
if (m_fallbackSurface) {
ASSERT(!m_currentFrame);
return;
@@ -178,6 +180,8 @@ PassRefPtr<SkPicture> RecordingImageBufferSurface::getPicture()
bool canUsePicture = finalizeFrameInternal(&fallbackReason);
m_imageBuffer->didFinalizeFrame();
+ ASSERT(canUsePicture || m_fallbackFactory);
+
if (canUsePicture) {
return m_previousFrame;
}
@@ -262,7 +266,7 @@ bool RecordingImageBufferSurface::finalizeFrameInternal(FallbackReason* fallback
return false;
}
- if (m_currentFrame->getRecordingCanvas()->getSaveCount() > ExpensiveCanvasHeuristicParameters::ExpensiveRecordingStackDepth) {
+ if (m_fallbackFactory && m_currentFrame->getRecordingCanvas()->getSaveCount() > ExpensiveCanvasHeuristicParameters::ExpensiveRecordingStackDepth) {
*fallbackReason = FallbackReasonRunawayStateStack;
return false;
}
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698