Chromium Code Reviews| 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 <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| 11 #include "base/threading/thread.h" | 11 #include "base/threading/thread.h" |
| 12 #include "cc/cc_export.h" | 12 #include "cc/cc_export.h" |
| 13 #include "cc/picture_pile_base.h" | 13 #include "cc/picture_pile_base.h" |
| 14 #include "skia/ext/refptr.h" | 14 #include "skia/ext/refptr.h" |
| 15 #include "third_party/skia/include/core/SkPicture.h" | 15 #include "third_party/skia/include/core/SkPicture.h" |
| 16 | 16 |
| 17 namespace cc { | 17 namespace cc { |
| 18 struct RenderingStats; | 18 struct RenderingStats; |
| 19 | 19 |
| 20 class CC_EXPORT PicturePileImpl : public PicturePileBase { | 20 class CC_EXPORT PicturePileImpl : public PicturePileBase { |
| 21 public: | 21 public: |
| 22 | |
|
reveman
2013/02/28 23:17:53
nit: no need for this blank line
| |
| 22 static scoped_refptr<PicturePileImpl> Create(); | 23 static scoped_refptr<PicturePileImpl> Create(); |
| 23 | 24 |
| 24 // Get paint-safe version of this picture for a specific thread. | 25 // Get paint-safe version of this picture for a specific thread. |
| 25 PicturePileImpl* GetCloneForDrawingOnThread(base::Thread*); | 26 PicturePileImpl* GetCloneForDrawingOnThread(base::Thread*); |
| 26 | 27 |
| 27 // Clone a paint-safe version of this picture. | 28 // Clone a paint-safe version of this picture. |
| 28 scoped_refptr<PicturePileImpl> CloneForDrawing() const; | 29 scoped_refptr<PicturePileImpl> CloneForDrawing() const; |
| 29 | 30 |
| 30 // Raster a subrect of this PicturePileImpl into the given canvas. | 31 // Raster a subrect of this PicturePileImpl into the given canvas. |
| 31 // It's only safe to call paint on a cloned version. | 32 // It's only safe to call paint on a cloned version. |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 42 std::list<skia::LazyPixelRef*>& pixel_refs); | 43 std::list<skia::LazyPixelRef*>& pixel_refs); |
| 43 | 44 |
| 44 void PushPropertiesTo(PicturePileImpl* other); | 45 void PushPropertiesTo(PicturePileImpl* other); |
| 45 | 46 |
| 46 skia::RefPtr<SkPicture> GetFlattenedPicture(); | 47 skia::RefPtr<SkPicture> GetFlattenedPicture(); |
| 47 | 48 |
| 48 void set_slow_down_raster_scale_factor(int factor) { | 49 void set_slow_down_raster_scale_factor(int factor) { |
| 49 slow_down_raster_scale_factor_for_debug_ = factor; | 50 slow_down_raster_scale_factor_for_debug_ = factor; |
| 50 } | 51 } |
| 51 | 52 |
| 52 bool IsCheapInRect(gfx::Rect content_rect, float contents_scale) const; | 53 void AnalyzeInRect(const gfx::Rect& content_rect, |
| 54 float contents_scale, | |
| 55 Picture::Analysis* analysis); | |
| 53 | 56 |
| 54 protected: | 57 protected: |
| 55 friend class PicturePile; | 58 friend class PicturePile; |
| 56 | 59 |
| 57 PicturePileImpl(); | 60 PicturePileImpl(); |
| 58 virtual ~PicturePileImpl(); | 61 virtual ~PicturePileImpl(); |
| 59 | 62 |
| 60 typedef std::map<base::PlatformThreadId, scoped_refptr<PicturePileImpl> > | 63 typedef std::map<base::PlatformThreadId, scoped_refptr<PicturePileImpl> > |
| 61 CloneMap; | 64 CloneMap; |
| 62 CloneMap clones_; | 65 CloneMap clones_; |
| 63 | 66 |
| 64 int slow_down_raster_scale_factor_for_debug_; | 67 int slow_down_raster_scale_factor_for_debug_; |
| 65 | 68 |
| 66 DISALLOW_COPY_AND_ASSIGN(PicturePileImpl); | 69 DISALLOW_COPY_AND_ASSIGN(PicturePileImpl); |
| 67 }; | 70 }; |
| 68 | 71 |
| 69 } // namespace cc | 72 } // namespace cc |
| 70 | 73 |
| 71 #endif // CC_PICTURE_PILE_IMPL_H_ | 74 #endif // CC_PICTURE_PILE_IMPL_H_ |
| OLD | NEW |