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/PaintArtifactToSkCanvas.h" | 5 #include "platform/graphics/paint/PaintArtifactToSkCanvas.h" |
6 | 6 |
7 #include "platform/graphics/paint/ClipPaintPropertyNode.h" | 7 #include "platform/graphics/paint/ClipPaintPropertyNode.h" |
8 #include "platform/graphics/paint/DrawingDisplayItem.h" | 8 #include "platform/graphics/paint/DrawingDisplayItem.h" |
9 #include "platform/graphics/paint/EffectPaintPropertyNode.h" | 9 #include "platform/graphics/paint/EffectPaintPropertyNode.h" |
10 #include "platform/graphics/paint/PaintArtifact.h" | 10 #include "platform/graphics/paint/PaintArtifact.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 const EffectPaintPropertyNode* chunkEffect = chunk.properties.effect.get
(); | 129 const EffectPaintPropertyNode* chunkEffect = chunk.properties.effect.get
(); |
130 applyEffectNodesToCanvas(previousEffect, chunkEffect, canvas); | 130 applyEffectNodesToCanvas(previousEffect, chunkEffect, canvas); |
131 previousEffect = chunkEffect; | 131 previousEffect = chunkEffect; |
132 | 132 |
133 // Draw the display items in the paint chunk. | 133 // Draw the display items in the paint chunk. |
134 for (const auto& displayItem : displayItems.itemsInPaintChunk(chunk)) | 134 for (const auto& displayItem : displayItems.itemsInPaintChunk(chunk)) |
135 paintDisplayItemToSkCanvas(displayItem, canvas); | 135 paintDisplayItemToSkCanvas(displayItem, canvas); |
136 } | 136 } |
137 } | 137 } |
138 | 138 |
139 PassRefPtr<SkPicture> paintArtifactToSkPicture(const PaintArtifact& artifact, co
nst SkRect& bounds) | 139 sk_sp<const SkPicture> paintArtifactToSkPicture(const PaintArtifact& artifact, c
onst SkRect& bounds) |
140 { | 140 { |
141 SkPictureRecorder recorder; | 141 SkPictureRecorder recorder; |
142 SkCanvas* canvas = recorder.beginRecording(bounds); | 142 SkCanvas* canvas = recorder.beginRecording(bounds); |
143 paintArtifactToSkCanvas(artifact, canvas); | 143 paintArtifactToSkCanvas(artifact, canvas); |
144 return adoptRef(recorder.endRecordingAsPicture()); | 144 return recorder.finishRecordingAsPicture(); |
145 } | 145 } |
146 | 146 |
147 } // namespace blink | 147 } // namespace blink |
OLD | NEW |