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

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

Issue 2476113002: Change call-sites now that SkCanvas is not ref-counted (Closed)
Patch Set: try fixing win again Created 4 years, 1 month 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 #ifndef CC_PLAYBACK_DISCARDABLE_IMAGE_MAP_H_ 5 #ifndef CC_PLAYBACK_DISCARDABLE_IMAGE_MAP_H_
6 #define CC_PLAYBACK_DISCARDABLE_IMAGE_MAP_H_ 6 #define CC_PLAYBACK_DISCARDABLE_IMAGE_MAP_H_
7 7
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 18 matching lines...) Expand all
29 class CC_EXPORT ScopedMetadataGenerator { 29 class CC_EXPORT ScopedMetadataGenerator {
30 public: 30 public:
31 ScopedMetadataGenerator(DiscardableImageMap* image_map, 31 ScopedMetadataGenerator(DiscardableImageMap* image_map,
32 const gfx::Size& bounds); 32 const gfx::Size& bounds);
33 ~ScopedMetadataGenerator(); 33 ~ScopedMetadataGenerator();
34 34
35 SkCanvas* canvas() { return metadata_canvas_.get(); } 35 SkCanvas* canvas() { return metadata_canvas_.get(); }
36 36
37 private: 37 private:
38 DiscardableImageMap* image_map_; 38 DiscardableImageMap* image_map_;
39 sk_sp<SkCanvas> metadata_canvas_; 39 std::unique_ptr<SkCanvas> metadata_canvas_;
40 }; 40 };
41 41
42 DiscardableImageMap(); 42 DiscardableImageMap();
43 ~DiscardableImageMap(); 43 ~DiscardableImageMap();
44 44
45 bool empty() const { return all_images_.empty(); } 45 bool empty() const { return all_images_.empty(); }
46 void GetDiscardableImagesInRect(const gfx::Rect& rect, 46 void GetDiscardableImagesInRect(const gfx::Rect& rect,
47 const gfx::SizeF& raster_scales, 47 const gfx::SizeF& raster_scales,
48 std::vector<DrawImage>* images) const; 48 std::vector<DrawImage>* images) const;
49 49
50 private: 50 private:
51 friend class ScopedMetadataGenerator; 51 friend class ScopedMetadataGenerator;
52 friend class DiscardableImageMapTest; 52 friend class DiscardableImageMapTest;
53 53
54 sk_sp<SkCanvas> BeginGeneratingMetadata(const gfx::Size& bounds); 54 std::unique_ptr<SkCanvas> BeginGeneratingMetadata(const gfx::Size& bounds);
55 void EndGeneratingMetadata(); 55 void EndGeneratingMetadata();
56 56
57 std::vector<std::pair<DrawImage, gfx::Rect>> all_images_; 57 std::vector<std::pair<DrawImage, gfx::Rect>> all_images_;
58 RTree images_rtree_; 58 RTree images_rtree_;
59 }; 59 };
60 60
61 } // namespace cc 61 } // namespace cc
62 62
63 #endif // CC_PLAYBACK_DISCARDABLE_IMAGE_MAP_H_ 63 #endif // CC_PLAYBACK_DISCARDABLE_IMAGE_MAP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698