| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/paint/SkPictureBuilder.h" | 5 #include "platform/graphics/paint/SkPictureBuilder.h" |
| 6 | 6 |
| 7 #include "platform/geometry/FloatRect.h" | 7 #include "platform/geometry/FloatRect.h" |
| 8 #include "platform/graphics/GraphicsContext.h" | 8 #include "platform/graphics/GraphicsContext.h" |
| 9 #include "platform/graphics/paint/PaintController.h" | 9 #include "platform/graphics/paint/PaintController.h" |
| 10 #include "wtf/PtrUtil.h" | 10 #include "wtf/PtrUtil.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 if (paintController) { | 23 if (paintController) { |
| 24 m_paintController = paintController; | 24 m_paintController = paintController; |
| 25 } else { | 25 } else { |
| 26 m_paintControllerPtr = PaintController::create(); | 26 m_paintControllerPtr = PaintController::create(); |
| 27 m_paintController = m_paintControllerPtr.get(); | 27 m_paintController = m_paintControllerPtr.get(); |
| 28 | 28 |
| 29 // Content painted with a new paint controller in SPv2 will have an | 29 // Content painted with a new paint controller in SPv2 will have an |
| 30 // independent property tree set. | 30 // independent property tree set. |
| 31 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 31 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 32 PaintChunk::Id id(*this, DisplayItem::kSVGImage); | 32 PaintChunk::Id id(*this, DisplayItem::kSVGImage); |
| 33 PropertyTreeState state( | 33 PropertyTreeState state(TransformPaintPropertyNode::root(), |
| 34 TransformPaintPropertyNode::root(), ClipPaintPropertyNode::root(), | 34 ClipPaintPropertyNode::root(), |
| 35 EffectPaintPropertyNode::root(), ScrollPaintPropertyNode::root()); | 35 EffectPaintPropertyNode::root()); |
| 36 m_paintController->updateCurrentPaintChunkProperties(&id, state); | 36 m_paintController->updateCurrentPaintChunkProperties(&id, state); |
| 37 } | 37 } |
| 38 } | 38 } |
| 39 #if DCHECK_IS_ON() | 39 #if DCHECK_IS_ON() |
| 40 m_paintController->setUsage(PaintController::ForSkPictureBuilder); | 40 m_paintController->setUsage(PaintController::ForSkPictureBuilder); |
| 41 #endif | 41 #endif |
| 42 | 42 |
| 43 m_context = WTF::wrapUnique( | 43 m_context = WTF::wrapUnique( |
| 44 new GraphicsContext(*m_paintController, disabledMode, metaData)); | 44 new GraphicsContext(*m_paintController, disabledMode, metaData)); |
| 45 | 45 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 56 } | 56 } |
| 57 | 57 |
| 58 sk_sp<SkPicture> SkPictureBuilder::endRecording() { | 58 sk_sp<SkPicture> SkPictureBuilder::endRecording() { |
| 59 m_context->beginRecording(m_bounds); | 59 m_context->beginRecording(m_bounds); |
| 60 m_paintController->commitNewDisplayItems(); | 60 m_paintController->commitNewDisplayItems(); |
| 61 m_paintController->paintArtifact().replay(*m_context); | 61 m_paintController->paintArtifact().replay(*m_context); |
| 62 return m_context->endRecording(); | 62 return m_context->endRecording(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 } // namespace blink | 65 } // namespace blink |
| OLD | NEW |