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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 std::list<skia::LazyPixelRef*>& pixel_refs); | 42 std::list<skia::LazyPixelRef*>& pixel_refs); |
43 | 43 |
44 void PushPropertiesTo(PicturePileImpl* other); | 44 void PushPropertiesTo(PicturePileImpl* other); |
45 | 45 |
46 skia::RefPtr<SkPicture> GetFlattenedPicture(); | 46 skia::RefPtr<SkPicture> GetFlattenedPicture(); |
47 | 47 |
48 void set_slow_down_raster_scale_factor(int factor) { | 48 void set_slow_down_raster_scale_factor(int factor) { |
49 slow_down_raster_scale_factor_for_debug_ = factor; | 49 slow_down_raster_scale_factor_for_debug_ = factor; |
50 } | 50 } |
51 | 51 |
52 bool IsCheapInRect(gfx::Rect content_rect, float contents_scale) const; | 52 bool GetColorIfSolidInRect(const gfx::Rect& content_rect, |
53 float contents_scale, | |
54 SkColor* color); | |
55 bool IsCheapInRect(const gfx::Rect& content_rect, | |
56 float contents_scale); | |
57 bool IsTransparentInRect(const gfx::Rect& content_rect, | |
58 float contents_scale); | |
53 | 59 |
54 protected: | 60 protected: |
55 friend class PicturePile; | 61 friend class PicturePile; |
56 | 62 |
57 PicturePileImpl(); | 63 PicturePileImpl(); |
58 virtual ~PicturePileImpl(); | 64 virtual ~PicturePileImpl(); |
59 | 65 |
66 struct Analysis { | |
67 Analysis(); | |
68 | |
69 bool is_solid_color_; | |
70 SkColor solid_color_; | |
71 bool is_transparent_; | |
72 bool is_cheap_; | |
73 | |
74 bool is_analyzed_; | |
75 gfx::Rect analyzed_content_rect_; | |
76 float analyzed_contents_scale_; | |
77 } analysis_; | |
reveman
2013/02/28 18:54:55
is caching of last analysis just so we can call Ge
Tom Hudson
2013/02/28 19:25:27
This is really expensive. We really ought to unify
reveman
2013/02/28 19:53:48
Picture pile knows nothing about tiles. ManagedTil
| |
78 | |
79 void AnalyzeInRect(const gfx::Rect& content_rect, | |
80 float contents_scale); | |
81 | |
60 typedef std::map<base::PlatformThreadId, scoped_refptr<PicturePileImpl> > | 82 typedef std::map<base::PlatformThreadId, scoped_refptr<PicturePileImpl> > |
61 CloneMap; | 83 CloneMap; |
62 CloneMap clones_; | 84 CloneMap clones_; |
63 | 85 |
64 int slow_down_raster_scale_factor_for_debug_; | 86 int slow_down_raster_scale_factor_for_debug_; |
65 | 87 |
66 DISALLOW_COPY_AND_ASSIGN(PicturePileImpl); | 88 DISALLOW_COPY_AND_ASSIGN(PicturePileImpl); |
67 }; | 89 }; |
68 | 90 |
69 } // namespace cc | 91 } // namespace cc |
70 | 92 |
71 #endif // CC_PICTURE_PILE_IMPL_H_ | 93 #endif // CC_PICTURE_PILE_IMPL_H_ |
OLD | NEW |