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

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

Issue 1869753003: Replace many skia::RefPtr with sk_sp<> in cc/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
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/discardable_image_map.h" 5 #include "cc/playback/discardable_image_map.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 const SkRect canvas_bounds_; 153 const SkRect canvas_bounds_;
154 std::vector<SkPaint> saved_paints_; 154 std::vector<SkPaint> saved_paints_;
155 }; 155 };
156 156
157 } // namespace 157 } // namespace
158 158
159 DiscardableImageMap::DiscardableImageMap() {} 159 DiscardableImageMap::DiscardableImageMap() {}
160 160
161 DiscardableImageMap::~DiscardableImageMap() {} 161 DiscardableImageMap::~DiscardableImageMap() {}
162 162
163 skia::RefPtr<SkCanvas> DiscardableImageMap::BeginGeneratingMetadata( 163 sk_sp<SkCanvas> DiscardableImageMap::BeginGeneratingMetadata(
164 const gfx::Size& bounds) { 164 const gfx::Size& bounds) {
165 DCHECK(all_images_.empty()); 165 DCHECK(all_images_.empty());
166 return skia::AdoptRef(new DiscardableImagesMetadataCanvas( 166 return sk_sp<SkCanvas>(new DiscardableImagesMetadataCanvas(
danakj 2016/04/14 19:37:32 no make_scoped_refptr equivalent? oh i found sk_m
tomhudson 2016/04/25 20:48:13 Done.
167 bounds.width(), bounds.height(), &all_images_)); 167 bounds.width(), bounds.height(), &all_images_));
168 } 168 }
169 169
170 void DiscardableImageMap::EndGeneratingMetadata() { 170 void DiscardableImageMap::EndGeneratingMetadata() {
171 images_rtree_.Build(all_images_, 171 images_rtree_.Build(all_images_,
172 [](const std::pair<DrawImage, gfx::Rect>& image) { 172 [](const std::pair<DrawImage, gfx::Rect>& image) {
173 return image.second; 173 return image.second;
174 }); 174 });
175 } 175 }
176 176
(...skipping 11 matching lines...) Expand all
188 DiscardableImageMap* image_map, 188 DiscardableImageMap* image_map,
189 const gfx::Size& bounds) 189 const gfx::Size& bounds)
190 : image_map_(image_map), 190 : image_map_(image_map),
191 metadata_canvas_(image_map->BeginGeneratingMetadata(bounds)) {} 191 metadata_canvas_(image_map->BeginGeneratingMetadata(bounds)) {}
192 192
193 DiscardableImageMap::ScopedMetadataGenerator::~ScopedMetadataGenerator() { 193 DiscardableImageMap::ScopedMetadataGenerator::~ScopedMetadataGenerator() {
194 image_map_->EndGeneratingMetadata(); 194 image_map_->EndGeneratingMetadata();
195 } 195 }
196 196
197 } // namespace cc 197 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698