Chromium Code Reviews| 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/ExpensiveCanvasHeuristicParameters.h" | 10 #include "platform/graphics/ExpensiveCanvasHeuristicParameters.h" |
| 10 #include "platform/graphics/GraphicsContext.h" | 11 #include "platform/graphics/GraphicsContext.h" |
| 11 #include "platform/graphics/ImageBuffer.h" | 12 #include "platform/graphics/ImageBuffer.h" |
| 12 #include "public/platform/Platform.h" | 13 #include "public/platform/Platform.h" |
| 13 #include "third_party/skia/include/core/SkCanvas.h" | 14 #include "third_party/skia/include/core/SkCanvas.h" |
| 14 #include "third_party/skia/include/core/SkPictureRecorder.h" | 15 #include "third_party/skia/include/core/SkPictureRecorder.h" |
| 15 #include "wtf/PassOwnPtr.h" | 16 #include "wtf/PassOwnPtr.h" |
| 16 #include "wtf/PassRefPtr.h" | 17 #include "wtf/PassRefPtr.h" |
| 17 | 18 |
| 18 namespace blink { | 19 namespace blink { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 88 if (m_currentFrame) { | 89 if (m_currentFrame) { |
| 89 RefPtr<SkPicture> currentPicture = adoptRef(m_currentFrame->endRecording ()); | 90 RefPtr<SkPicture> currentPicture = adoptRef(m_currentFrame->endRecording ()); |
| 90 currentPicture->playback(m_fallbackSurface->canvas()); | 91 currentPicture->playback(m_fallbackSurface->canvas()); |
| 91 m_currentFrame.clear(); | 92 m_currentFrame.clear(); |
| 92 } | 93 } |
| 93 | 94 |
| 94 if (m_imageBuffer) { | 95 if (m_imageBuffer) { |
| 95 m_imageBuffer->resetCanvas(m_fallbackSurface->canvas()); | 96 m_imageBuffer->resetCanvas(m_fallbackSurface->canvas()); |
| 96 } | 97 } |
| 97 | 98 |
| 99 CanvasMetrics::countCanvasContextStat(CanvasMetrics::DisplayListFallbackToRa ster); | |
|
Justin Novosad
2015/11/19 20:36:09
DisplayList2DCanvasFallbackToRaster
zmin
2015/11/19 22:23:36
Done.
| |
| 98 } | 100 } |
| 99 | 101 |
| 100 PassRefPtr<SkImage> RecordingImageBufferSurface::newImageSnapshot(AccelerationHi nt hint) | 102 PassRefPtr<SkImage> RecordingImageBufferSurface::newImageSnapshot(AccelerationHi nt hint) |
| 101 { | 103 { |
| 102 if (!m_fallbackSurface) | 104 if (!m_fallbackSurface) |
| 103 fallBackToRasterCanvas(); | 105 fallBackToRasterCanvas(); |
| 104 return m_fallbackSurface->newImageSnapshot(hint); | 106 return m_fallbackSurface->newImageSnapshot(hint); |
| 105 } | 107 } |
| 106 | 108 |
| 107 SkCanvas* RecordingImageBufferSurface::canvas() | 109 SkCanvas* RecordingImageBufferSurface::canvas() |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 270 | 272 |
| 271 void RecordingImageBufferSurface::setIsHidden(bool hidden) | 273 void RecordingImageBufferSurface::setIsHidden(bool hidden) |
| 272 { | 274 { |
| 273 if (m_fallbackSurface) | 275 if (m_fallbackSurface) |
| 274 m_fallbackSurface->setIsHidden(hidden); | 276 m_fallbackSurface->setIsHidden(hidden); |
| 275 else | 277 else |
| 276 ImageBufferSurface::setIsHidden(hidden); | 278 ImageBufferSurface::setIsHidden(hidden); |
| 277 } | 279 } |
| 278 | 280 |
| 279 } // namespace blink | 281 } // namespace blink |
| OLD | NEW |