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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "cc/cc_export.h" | 10 #include "cc/cc_export.h" |
11 #include "cc/picture.h" | 11 #include "cc/picture.h" |
12 #include "cc/scoped_ptr_vector.h" | 12 #include "cc/scoped_ptr_vector.h" |
13 #include "ui/gfx/rect.h" | 13 #include "ui/gfx/rect.h" |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 class PicturePile; | 16 class PicturePile; |
17 | 17 |
18 class CC_EXPORT PicturePileImpl : public base::RefCounted<PicturePileImpl> { | 18 class CC_EXPORT PicturePileImpl : public base::RefCounted<PicturePileImpl> { |
19 public: | 19 public: |
20 static scoped_refptr<PicturePileImpl> Create(); | 20 static scoped_refptr<PicturePileImpl> Create(); |
21 | 21 |
22 // Clone a paint-safe version of this picture. | 22 // Clone a paint-safe version of this picture. |
23 scoped_refptr<PicturePileImpl> CloneForDrawing() const; | 23 scoped_refptr<PicturePileImpl> CloneForDrawing() const; |
24 | 24 |
25 // Raster a subrect of this PicturePileImpl into the given canvas. | 25 // Raster a subrect of this PicturePileImpl into the given canvas. |
26 // It's only safe to call paint on a cloned version. | 26 // It's only safe to call paint on a cloned version. |
27 // It is assumed that contentsScale has already been applied to this canvas. | 27 // It is assumed that contentsScale has already been applied to this canvas. |
28 void Raster(SkCanvas* canvas, gfx::Rect rect); | 28 void Raster(SkCanvas* canvas, gfx::Rect rect); |
29 | 29 |
| 30 double rasterizeTime(); |
| 31 |
30 private: | 32 private: |
31 friend class PicturePile; | 33 friend class PicturePile; |
32 | 34 |
33 PicturePileImpl(); | 35 PicturePileImpl(); |
34 ~PicturePileImpl(); | 36 ~PicturePileImpl(); |
35 | 37 |
36 std::vector<scoped_refptr<Picture> > pile_; | 38 std::vector<scoped_refptr<Picture> > pile_; |
| 39 double rasterize_time_in_seconds_; |
37 | 40 |
38 friend class base::RefCounted<PicturePileImpl>; | 41 friend class base::RefCounted<PicturePileImpl>; |
39 DISALLOW_COPY_AND_ASSIGN(PicturePileImpl); | 42 DISALLOW_COPY_AND_ASSIGN(PicturePileImpl); |
40 }; | 43 }; |
41 | 44 |
42 } // namespace cc | 45 } // namespace cc |
43 | 46 |
44 #endif // CC_PICTURE_PILE_IMPL_H_ | 47 #endif // CC_PICTURE_PILE_IMPL_H_ |
OLD | NEW |