Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(195)

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/PaintArtifactToSkCanvas.cpp

Issue 1819683002: Use sk_sp-based picture recording APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: skspify GetPicture/GetFlattenedPicture Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698