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

Side by Side Diff: Source/platform/graphics/RecordingImageBufferSurface.cpp

Issue 1297663002: Eliminate deferral overhead with canvas to canvas draws (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: git cl web 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 6
7 #include "platform/graphics/RecordingImageBufferSurface.h" 7 #include "platform/graphics/RecordingImageBufferSurface.h"
8 8
9 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h" 9 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h"
10 #include "platform/graphics/GraphicsContext.h" 10 #include "platform/graphics/GraphicsContext.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 SkCanvas* RecordingImageBufferSurface::canvas() 107 SkCanvas* RecordingImageBufferSurface::canvas()
108 { 108 {
109 if (m_fallbackSurface) 109 if (m_fallbackSurface)
110 return m_fallbackSurface->canvas(); 110 return m_fallbackSurface->canvas();
111 111
112 ASSERT(m_currentFrame->getRecordingCanvas()); 112 ASSERT(m_currentFrame->getRecordingCanvas());
113 return m_currentFrame->getRecordingCanvas(); 113 return m_currentFrame->getRecordingCanvas();
114 } 114 }
115 115
116 SkCanvas* RecordingImageBufferSurface::immediateCanvas() 116 void RecordingImageBufferSurface::disableDeferral()
117 { 117 {
118 if (!m_fallbackSurface) 118 if (!m_fallbackSurface)
119 fallBackToRasterCanvas(); 119 fallBackToRasterCanvas();
120
121 return m_fallbackSurface->canvas();
122 } 120 }
123 121
124 PassRefPtr<SkPicture> RecordingImageBufferSurface::getPicture() 122 PassRefPtr<SkPicture> RecordingImageBufferSurface::getPicture()
125 { 123 {
126 if (m_fallbackSurface) 124 if (m_fallbackSurface)
127 return nullptr; 125 return nullptr;
128 126
129 bool canUsePicture = finalizeFrameInternal(); 127 bool canUsePicture = finalizeFrameInternal();
130 m_imageBuffer->didFinalizeFrame(); 128 m_imageBuffer->didFinalizeFrame();
131 129
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 279
282 void RecordingImageBufferSurface::setIsHidden(bool hidden) 280 void RecordingImageBufferSurface::setIsHidden(bool hidden)
283 { 281 {
284 if (m_fallbackSurface) 282 if (m_fallbackSurface)
285 m_fallbackSurface->setIsHidden(hidden); 283 m_fallbackSurface->setIsHidden(hidden);
286 else 284 else
287 ImageBufferSurface::setIsHidden(hidden); 285 ImageBufferSurface::setIsHidden(hidden);
288 } 286 }
289 287
290 } // namespace blink 288 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/RecordingImageBufferSurface.h ('k') | Source/platform/graphics/UnacceleratedImageBufferSurface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698