OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_PICTURE_PILE_IMPL_H_ | 5 #ifndef CC_PICTURE_PILE_IMPL_H_ |
6 #define CC_PICTURE_PILE_IMPL_H_ | 6 #define CC_PICTURE_PILE_IMPL_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 std::list<skia::LazyPixelRef*>& pixel_refs); | 41 std::list<skia::LazyPixelRef*>& pixel_refs); |
42 | 42 |
43 void PushPropertiesTo(PicturePileImpl* other); | 43 void PushPropertiesTo(PicturePileImpl* other); |
44 | 44 |
45 skia::RefPtr<SkPicture> GetFlattenedPicture(); | 45 skia::RefPtr<SkPicture> GetFlattenedPicture(); |
46 | 46 |
47 void set_slow_down_raster_scale_factor(int factor) { | 47 void set_slow_down_raster_scale_factor(int factor) { |
48 slow_down_raster_scale_factor_for_debug_ = factor; | 48 slow_down_raster_scale_factor_for_debug_ = factor; |
49 } | 49 } |
50 | 50 |
51 bool IsCheapInRect(gfx::Rect content_rect, float contents_scale) const; | 51 struct Analysis { |
| 52 Analysis(); |
| 53 |
| 54 bool is_solid_color; |
| 55 bool is_transparent; |
| 56 bool is_cheap_to_raster; |
| 57 SkColor solid_color; |
| 58 }; |
| 59 |
| 60 void AnalyzeInRect(const gfx::Rect& content_rect, |
| 61 float contents_scale, |
| 62 Analysis* analysis); |
52 | 63 |
53 protected: | 64 protected: |
54 friend class PicturePile; | 65 friend class PicturePile; |
55 | 66 |
56 PicturePileImpl(); | 67 PicturePileImpl(); |
57 virtual ~PicturePileImpl(); | 68 virtual ~PicturePileImpl(); |
58 | 69 |
59 typedef std::vector<scoped_refptr<PicturePileImpl> > PicturePileVector; | 70 typedef std::vector<scoped_refptr<PicturePileImpl> > PicturePileVector; |
60 PicturePileVector clones_; | 71 PicturePileVector clones_; |
61 | 72 |
62 int slow_down_raster_scale_factor_for_debug_; | 73 int slow_down_raster_scale_factor_for_debug_; |
63 | 74 |
64 DISALLOW_COPY_AND_ASSIGN(PicturePileImpl); | 75 DISALLOW_COPY_AND_ASSIGN(PicturePileImpl); |
65 }; | 76 }; |
66 | 77 |
67 } // namespace cc | 78 } // namespace cc |
68 | 79 |
69 #endif // CC_PICTURE_PILE_IMPL_H_ | 80 #endif // CC_PICTURE_PILE_IMPL_H_ |
OLD | NEW |