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

Side by Side Diff: cc/playback/clip_path_display_item.cc

Issue 1866203004: Convert //cc from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrcc: rebase Created 4 years, 8 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
« no previous file with comments | « cc/playback/clip_path_display_item.h ('k') | cc/playback/compositing_display_item.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "cc/playback/clip_path_display_item.h" 5 #include "cc/playback/clip_path_display_item.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 ImageSerializationProcessor* image_serialization_processor) const { 55 ImageSerializationProcessor* image_serialization_processor) const {
56 proto->set_type(proto::DisplayItem::Type_ClipPath); 56 proto->set_type(proto::DisplayItem::Type_ClipPath);
57 57
58 proto::ClipPathDisplayItem* details = proto->mutable_clip_path_item(); 58 proto::ClipPathDisplayItem* details = proto->mutable_clip_path_item();
59 details->set_clip_op(SkRegionOpToProto(clip_op_)); 59 details->set_clip_op(SkRegionOpToProto(clip_op_));
60 details->set_antialias(antialias_); 60 details->set_antialias(antialias_);
61 61
62 // Just use skia's serialization method for the SkPath for now. 62 // Just use skia's serialization method for the SkPath for now.
63 size_t path_size = clip_path_.writeToMemory(nullptr); 63 size_t path_size = clip_path_.writeToMemory(nullptr);
64 if (path_size > 0) { 64 if (path_size > 0) {
65 scoped_ptr<uint8_t[]> buffer(new uint8_t[path_size]); 65 std::unique_ptr<uint8_t[]> buffer(new uint8_t[path_size]);
66 clip_path_.writeToMemory(buffer.get()); 66 clip_path_.writeToMemory(buffer.get());
67 details->set_clip_path(buffer.get(), path_size); 67 details->set_clip_path(buffer.get(), path_size);
68 } 68 }
69 } 69 }
70 70
71 void ClipPathDisplayItem::Raster(SkCanvas* canvas, 71 void ClipPathDisplayItem::Raster(SkCanvas* canvas,
72 const gfx::Rect& canvas_target_playback_rect, 72 const gfx::Rect& canvas_target_playback_rect,
73 SkPicture::AbortCallback* callback) const { 73 SkPicture::AbortCallback* callback) const {
74 canvas->save(); 74 canvas->save();
75 canvas->clipPath(clip_path_, clip_op_, antialias_); 75 canvas->clipPath(clip_path_, clip_op_, antialias_);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 array->AppendString( 118 array->AppendString(
119 base::StringPrintf("EndClipPathDisplayItem visualRect: [%s]", 119 base::StringPrintf("EndClipPathDisplayItem visualRect: [%s]",
120 visual_rect.ToString().c_str())); 120 visual_rect.ToString().c_str()));
121 } 121 }
122 122
123 size_t EndClipPathDisplayItem::ExternalMemoryUsage() const { 123 size_t EndClipPathDisplayItem::ExternalMemoryUsage() const {
124 return 0; 124 return 0;
125 } 125 }
126 126
127 } // namespace cc 127 } // namespace cc
OLDNEW
« no previous file with comments | « cc/playback/clip_path_display_item.h ('k') | cc/playback/compositing_display_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698