| 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 "core/paint/HTMLCanvasPainter.h" | 5 #include "core/paint/HTMLCanvasPainter.h" |
| 6 | 6 |
| 7 #include "core/html/HTMLCanvasElement.h" | 7 #include "core/html/HTMLCanvasElement.h" |
| 8 #include "core/html/canvas/CanvasRenderingContext.h" | 8 #include "core/html/canvas/CanvasRenderingContext.h" |
| 9 #include "core/layout/LayoutHTMLCanvas.h" | 9 #include "core/layout/LayoutHTMLCanvas.h" |
| 10 #include "core/paint/LayoutObjectDrawingRecorder.h" | 10 #include "core/paint/LayoutObjectDrawingRecorder.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 LayoutRect paintRect = m_layoutHTMLCanvas.replacedContentRect(); | 24 LayoutRect paintRect = m_layoutHTMLCanvas.replacedContentRect(); |
| 25 paintRect.moveBy(paintOffset); | 25 paintRect.moveBy(paintOffset); |
| 26 | 26 |
| 27 HTMLCanvasElement* canvas = toHTMLCanvasElement(m_layoutHTMLCanvas.node()); | 27 HTMLCanvasElement* canvas = toHTMLCanvasElement(m_layoutHTMLCanvas.node()); |
| 28 | 28 |
| 29 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() | 29 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() |
| 30 && canvas->renderingContext() && canvas->renderingContext()->isAccelerat
ed()) { | 30 && canvas->renderingContext() && canvas->renderingContext()->isAccelerat
ed()) { |
| 31 if (WebLayer* layer = canvas->renderingContext()->platformLayer()) { | 31 if (WebLayer* layer = canvas->renderingContext()->platformLayer()) { |
| 32 IntRect pixelSnappedRect = pixelSnappedIntRect(contentRect); | 32 IntRect pixelSnappedRect = pixelSnappedIntRect(contentRect); |
| 33 recordForeignLayer( | 33 recordForeignLayer( |
| 34 context, m_layoutHTMLCanvas, DisplayItem::ForeignLayerCanvas, | 34 context, m_layoutHTMLCanvas, DisplayItem::kForeignLayerCanvas, |
| 35 layer, pixelSnappedRect.location(), pixelSnappedRect.size()); | 35 layer, pixelSnappedRect.location(), pixelSnappedRect.size()); |
| 36 return; | 36 return; |
| 37 } | 37 } |
| 38 } | 38 } |
| 39 | 39 |
| 40 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(context, m_layou
tHTMLCanvas, paintInfo.phase)) | 40 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(context, m_layou
tHTMLCanvas, paintInfo.phase)) |
| 41 return; | 41 return; |
| 42 | 42 |
| 43 LayoutObjectDrawingRecorder drawingRecorder(context, m_layoutHTMLCanvas, pai
ntInfo.phase, contentRect); | 43 LayoutObjectDrawingRecorder drawingRecorder(context, m_layoutHTMLCanvas, pai
ntInfo.phase, contentRect); |
| 44 | 44 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 58 InterpolationQuality previousInterpolationQuality = context.imageInterpolati
onQuality(); | 58 InterpolationQuality previousInterpolationQuality = context.imageInterpolati
onQuality(); |
| 59 context.setImageInterpolationQuality(interpolationQuality); | 59 context.setImageInterpolationQuality(interpolationQuality); |
| 60 canvas->paint(context, paintRect); | 60 canvas->paint(context, paintRect); |
| 61 context.setImageInterpolationQuality(previousInterpolationQuality); | 61 context.setImageInterpolationQuality(previousInterpolationQuality); |
| 62 | 62 |
| 63 if (clip) | 63 if (clip) |
| 64 context.restore(); | 64 context.restore(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 } // namespace blink | 67 } // namespace blink |
| OLD | NEW |