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 <list> | 8 #include <list> |
| 9 #include <utility> |
9 | 10 |
10 #include "base/hash_tables.h" | 11 #include "base/hash_tables.h" |
11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
12 #include "cc/base/cc_export.h" | 13 #include "cc/base/cc_export.h" |
13 #include "cc/base/hash_pair.h" | 14 #include "cc/base/hash_pair.h" |
14 #include "cc/base/region.h" | 15 #include "cc/base/region.h" |
15 #include "cc/base/tiling_data.h" | 16 #include "cc/base/tiling_data.h" |
16 #include "cc/resources/picture.h" | 17 #include "cc/resources/picture.h" |
17 #include "ui/gfx/size.h" | 18 #include "ui/gfx/size.h" |
18 | 19 |
19 namespace cc { | 20 namespace cc { |
20 | 21 |
21 class CC_EXPORT PicturePileBase : public base::RefCounted<PicturePileBase> { | 22 class CC_EXPORT PicturePileBase : public base::RefCounted<PicturePileBase> { |
22 public: | 23 public: |
23 PicturePileBase(); | 24 PicturePileBase(); |
24 PicturePileBase(const PicturePileBase* other); | 25 explicit PicturePileBase(const PicturePileBase* other); |
25 PicturePileBase(const PicturePileBase* other, unsigned thread_index); | 26 PicturePileBase(const PicturePileBase* other, unsigned thread_index); |
26 | 27 |
27 void Resize(gfx::Size size); | 28 void Resize(gfx::Size size); |
28 gfx::Size size() const { return tiling_.total_size(); } | 29 gfx::Size size() const { return tiling_.total_size(); } |
29 void SetMinContentsScale(float min_contents_scale); | 30 void SetMinContentsScale(float min_contents_scale); |
30 | 31 |
31 void UpdateRecordedRegion(); | 32 void UpdateRecordedRegion(); |
32 const Region& recorded_region() const { return recorded_region_; } | 33 const Region& recorded_region() const { return recorded_region_; } |
33 | 34 |
34 int num_tiles_x() const { return tiling_.num_tiles_x(); } | 35 int num_tiles_x() const { return tiling_.num_tiles_x(); } |
(...skipping 29 matching lines...) Expand all Loading... |
64 private: | 65 private: |
65 void SetBufferPixels(int buffer_pixels); | 66 void SetBufferPixels(int buffer_pixels); |
66 | 67 |
67 friend class base::RefCounted<PicturePileBase>; | 68 friend class base::RefCounted<PicturePileBase>; |
68 DISALLOW_COPY_AND_ASSIGN(PicturePileBase); | 69 DISALLOW_COPY_AND_ASSIGN(PicturePileBase); |
69 }; | 70 }; |
70 | 71 |
71 } // namespace cc | 72 } // namespace cc |
72 | 73 |
73 #endif // CC_RESOURCES_PICTURE_PILE_BASE_H_ | 74 #endif // CC_RESOURCES_PICTURE_PILE_BASE_H_ |
OLD | NEW |