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_RESOURCES_PICTURE_PILE_IMPL_H_ | 5 #ifndef CC_RESOURCES_PICTURE_PILE_IMPL_H_ |
6 #define CC_RESOURCES_PICTURE_PILE_IMPL_H_ | 6 #define CC_RESOURCES_PICTURE_PILE_IMPL_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 | 10 |
11 #include "cc/base/cc_export.h" | 11 #include "cc/base/cc_export.h" |
12 #include "cc/resources/picture_pile_base.h" | 12 #include "cc/resources/picture_pile_base.h" |
| 13 #include "skia/ext/analysis_canvas.h" |
13 #include "skia/ext/refptr.h" | 14 #include "skia/ext/refptr.h" |
14 #include "third_party/skia/include/core/SkPicture.h" | 15 #include "third_party/skia/include/core/SkPicture.h" |
15 | 16 |
16 namespace cc { | 17 namespace cc { |
17 struct RenderingStats; | 18 struct RenderingStats; |
18 | 19 |
19 class CC_EXPORT PicturePileImpl : public PicturePileBase { | 20 class CC_EXPORT PicturePileImpl : public PicturePileBase { |
20 public: | 21 public: |
21 static scoped_refptr<PicturePileImpl> Create(); | 22 static scoped_refptr<PicturePileImpl> Create(); |
22 static scoped_refptr<PicturePileImpl> CreateFromOther( | 23 static scoped_refptr<PicturePileImpl> CreateFromOther( |
(...skipping 13 matching lines...) Expand all Loading... |
36 | 37 |
37 void GatherPixelRefs( | 38 void GatherPixelRefs( |
38 gfx::Rect content_rect, | 39 gfx::Rect content_rect, |
39 float contents_scale, | 40 float contents_scale, |
40 std::list<skia::LazyPixelRef*>& pixel_refs); | 41 std::list<skia::LazyPixelRef*>& pixel_refs); |
41 | 42 |
42 skia::RefPtr<SkPicture> GetFlattenedPicture(); | 43 skia::RefPtr<SkPicture> GetFlattenedPicture(); |
43 | 44 |
44 struct Analysis { | 45 struct Analysis { |
45 Analysis(); | 46 Analysis(); |
| 47 ~Analysis(); |
46 | 48 |
47 bool is_solid_color; | 49 bool is_solid_color; |
48 bool is_transparent; | 50 bool is_transparent; |
49 bool is_cheap_to_raster; | 51 bool is_cheap_to_raster; |
50 SkColor solid_color; | 52 SkColor solid_color; |
| 53 |
| 54 skia::AnalysisCanvas::LazyPixelRefList lazy_pixel_refs; |
51 }; | 55 }; |
52 | 56 |
53 void AnalyzeInRect(const gfx::Rect& content_rect, | 57 void AnalyzeInRect(const gfx::Rect& content_rect, |
54 float contents_scale, | 58 float contents_scale, |
55 Analysis* analysis); | 59 Analysis* analysis); |
56 | 60 |
57 protected: | 61 protected: |
58 friend class PicturePile; | 62 friend class PicturePile; |
59 | 63 |
60 PicturePileImpl(); | 64 PicturePileImpl(); |
(...skipping 19 matching lines...) Expand all Loading... |
80 // This guarantees thread-safe access during the life | 84 // This guarantees thread-safe access during the life |
81 // time of a PicturePileImpl instance. | 85 // time of a PicturePileImpl instance. |
82 const ClonesForDrawing clones_for_drawing_; | 86 const ClonesForDrawing clones_for_drawing_; |
83 | 87 |
84 DISALLOW_COPY_AND_ASSIGN(PicturePileImpl); | 88 DISALLOW_COPY_AND_ASSIGN(PicturePileImpl); |
85 }; | 89 }; |
86 | 90 |
87 } // namespace cc | 91 } // namespace cc |
88 | 92 |
89 #endif // CC_RESOURCES_PICTURE_PILE_IMPL_H_ | 93 #endif // CC_RESOURCES_PICTURE_PILE_IMPL_H_ |
OLD | NEW |