| 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 "platform/graphics/RecordingImageBufferSurface.h" | 5 #include "platform/graphics/RecordingImageBufferSurface.h" |
| 6 | 6 |
| 7 #include "platform/Histogram.h" | 7 #include "platform/Histogram.h" |
| 8 #include "platform/graphics/CanvasMetrics.h" | 8 #include "platform/graphics/CanvasMetrics.h" |
| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 willOverwriteCanvas(); | 65 willOverwriteCanvas(); |
| 66 } | 66 } |
| 67 fallBackToRasterCanvas(FallbackReasonWritePixels); | 67 fallBackToRasterCanvas(FallbackReasonWritePixels); |
| 68 } | 68 } |
| 69 return m_fallbackSurface->writePixels(origInfo, pixels, rowBytes, x, y); | 69 return m_fallbackSurface->writePixels(origInfo, pixels, rowBytes, x, y); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void RecordingImageBufferSurface::fallBackToRasterCanvas(FallbackReason reason) | 72 void RecordingImageBufferSurface::fallBackToRasterCanvas(FallbackReason reason) |
| 73 { | 73 { |
| 74 ASSERT(m_fallbackFactory); | 74 ASSERT(m_fallbackFactory); |
| 75 DCHECK(reason != FallbackReasonUnknown); | 75 CHECK(reason != FallbackReasonUnknown); |
| 76 | 76 |
| 77 if (m_fallbackSurface) { | 77 if (m_fallbackSurface) { |
| 78 ASSERT(!m_currentFrame); | 78 ASSERT(!m_currentFrame); |
| 79 return; | 79 return; |
| 80 } | 80 } |
| 81 | 81 |
| 82 DEFINE_THREAD_SAFE_STATIC_LOCAL(EnumerationHistogram, canvasFallbackHistogra
m, new EnumerationHistogram("Canvas.DisplayListFallbackReason", FallbackReasonCo
unt)); | 82 DEFINE_THREAD_SAFE_STATIC_LOCAL(EnumerationHistogram, canvasFallbackHistogra
m, new EnumerationHistogram("Canvas.DisplayListFallbackReason", FallbackReasonCo
unt)); |
| 83 canvasFallbackHistogram.count(reason); | 83 canvasFallbackHistogram.count(reason); |
| 84 | 84 |
| 85 m_fallbackSurface = m_fallbackFactory->createSurface(size(), getOpacityMode(
)); | 85 m_fallbackSurface = m_fallbackFactory->createSurface(size(), getOpacityMode(
)); |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 | 360 |
| 361 void RecordingImageBufferSurface::setIsHidden(bool hidden) | 361 void RecordingImageBufferSurface::setIsHidden(bool hidden) |
| 362 { | 362 { |
| 363 if (m_fallbackSurface) | 363 if (m_fallbackSurface) |
| 364 m_fallbackSurface->setIsHidden(hidden); | 364 m_fallbackSurface->setIsHidden(hidden); |
| 365 else | 365 else |
| 366 ImageBufferSurface::setIsHidden(hidden); | 366 ImageBufferSurface::setIsHidden(hidden); |
| 367 } | 367 } |
| 368 | 368 |
| 369 } // namespace blink | 369 } // namespace blink |
| OLD | NEW |