OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |