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