| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_BASE_H_ | 5 #ifndef CC_RESOURCES_PICTURE_PILE_BASE_H_ |
| 6 #define CC_RESOURCES_PICTURE_PILE_BASE_H_ | 6 #define CC_RESOURCES_PICTURE_PILE_BASE_H_ |
| 7 | 7 |
| 8 #include <bitset> | 8 #include <bitset> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "cc/base/cc_export.h" | 14 #include "cc/base/cc_export.h" |
| 15 #include "cc/base/region.h" | 15 #include "cc/base/region.h" |
| 16 #include "cc/base/tiling_data.h" | 16 #include "cc/base/tiling_data.h" |
| 17 #include "cc/resources/picture.h" | 17 #include "cc/resources/picture.h" |
| 18 #include "ui/gfx/geometry/size.h" | 18 #include "ui/gfx/geometry/size.h" |
| 19 | 19 |
| 20 namespace base { | 20 namespace base { |
| 21 namespace debug { | 21 namespace debug { |
| 22 class TracedValue; | 22 class TracedValue; |
| 23 } | 23 } |
| 24 class Value; | 24 class Value; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace cc { | 27 namespace cc { |
| 28 | 28 |
| 29 class CC_EXPORT PicturePileBase : public base::RefCounted<PicturePileBase> { | 29 class CC_EXPORT PicturePileBase |
| 30 : public base::RefCountedThreadSafe<PicturePileBase> { |
| 30 public: | 31 public: |
| 31 PicturePileBase(); | 32 PicturePileBase(); |
| 32 explicit PicturePileBase(const PicturePileBase* other); | 33 explicit PicturePileBase(const PicturePileBase* other); |
| 33 | 34 |
| 34 gfx::Size tiling_size() const { return tiling_.tiling_size(); } | 35 gfx::Size tiling_size() const { return tiling_.tiling_size(); } |
| 35 void SetMinContentsScale(float min_contents_scale); | 36 void SetMinContentsScale(float min_contents_scale); |
| 36 | 37 |
| 37 // If non-empty, all pictures tiles inside this rect are recorded. There may | 38 // If non-empty, all pictures tiles inside this rect are recorded. There may |
| 38 // be recordings outside this rect, but everything inside the rect is | 39 // be recordings outside this rect, but everything inside the rect is |
| 39 // recorded. | 40 // recorded. |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 // positive. | 130 // positive. |
| 130 bool has_any_recordings_; | 131 bool has_any_recordings_; |
| 131 bool has_text_; | 132 bool has_text_; |
| 132 bool is_mask_; | 133 bool is_mask_; |
| 133 bool is_solid_color_; | 134 bool is_solid_color_; |
| 134 SkColor solid_color_; | 135 SkColor solid_color_; |
| 135 | 136 |
| 136 private: | 137 private: |
| 137 void SetBufferPixels(int buffer_pixels); | 138 void SetBufferPixels(int buffer_pixels); |
| 138 | 139 |
| 139 friend class base::RefCounted<PicturePileBase>; | 140 friend class base::RefCountedThreadSafe<PicturePileBase>; |
| 140 DISALLOW_COPY_AND_ASSIGN(PicturePileBase); | 141 DISALLOW_COPY_AND_ASSIGN(PicturePileBase); |
| 141 }; | 142 }; |
| 142 | 143 |
| 143 } // namespace cc | 144 } // namespace cc |
| 144 | 145 |
| 145 #endif // CC_RESOURCES_PICTURE_PILE_BASE_H_ | 146 #endif // CC_RESOURCES_PICTURE_PILE_BASE_H_ |
| OLD | NEW |