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

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

Issue 1512803004: Use refs for GraphicsContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ScrollbarTheme
Patch Set: Created 5 years 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
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/CanvasMetrics.h" 9 #include "platform/graphics/CanvasMetrics.h"
10 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h" 10 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 m_previousFrame = adoptRef(m_currentFrame->endRecording()); 198 m_previousFrame = adoptRef(m_currentFrame->endRecording());
199 m_previousFrameHasExpensiveOp = m_currentFrameHasExpensiveOp; 199 m_previousFrameHasExpensiveOp = m_currentFrameHasExpensiveOp;
200 m_previousFramePixelCount = m_currentFramePixelCount; 200 m_previousFramePixelCount = m_currentFramePixelCount;
201 if (!initializeCurrentFrame()) 201 if (!initializeCurrentFrame())
202 return false; 202 return false;
203 203
204 m_frameWasCleared = false; 204 m_frameWasCleared = false;
205 return true; 205 return true;
206 } 206 }
207 207
208 void RecordingImageBufferSurface::draw(GraphicsContext* context, const FloatRect & destRect, const FloatRect& srcRect, SkXfermode::Mode op) 208 void RecordingImageBufferSurface::draw(GraphicsContext& context, const FloatRect & destRect, const FloatRect& srcRect, SkXfermode::Mode op)
209 { 209 {
210 if (m_fallbackSurface) { 210 if (m_fallbackSurface) {
211 m_fallbackSurface->draw(context, destRect, srcRect, op); 211 m_fallbackSurface->draw(context, destRect, srcRect, op);
212 return; 212 return;
213 } 213 }
214 214
215 RefPtr<SkPicture> picture = getPicture(); 215 RefPtr<SkPicture> picture = getPicture();
216 if (picture) { 216 if (picture) {
217 context->compositePicture(picture.get(), destRect, srcRect, op); 217 context.compositePicture(picture.get(), destRect, srcRect, op);
218 } else { 218 } else {
219 ImageBufferSurface::draw(context, destRect, srcRect, op); 219 ImageBufferSurface::draw(context, destRect, srcRect, op);
220 } 220 }
221 } 221 }
222 222
223 bool RecordingImageBufferSurface::isExpensiveToPaint() 223 bool RecordingImageBufferSurface::isExpensiveToPaint()
224 { 224 {
225 if (m_fallbackSurface) 225 if (m_fallbackSurface)
226 return m_fallbackSurface->isExpensiveToPaint(); 226 return m_fallbackSurface->isExpensiveToPaint();
227 227
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 272
273 void RecordingImageBufferSurface::setIsHidden(bool hidden) 273 void RecordingImageBufferSurface::setIsHidden(bool hidden)
274 { 274 {
275 if (m_fallbackSurface) 275 if (m_fallbackSurface)
276 m_fallbackSurface->setIsHidden(hidden); 276 m_fallbackSurface->setIsHidden(hidden);
277 else 277 else
278 ImageBufferSurface::setIsHidden(hidden); 278 ImageBufferSurface::setIsHidden(hidden);
279 } 279 }
280 280
281 } // namespace blink 281 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698