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_RESOURCES_PICTURE_PILE_IMPL_H_ | 5 #ifndef CC_RESOURCES_PICTURE_PILE_IMPL_H_ |
| 6 #define CC_RESOURCES_PICTURE_PILE_IMPL_H_ | 6 #define CC_RESOURCES_PICTURE_PILE_IMPL_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "cc/base/cc_export.h" | 14 #include "cc/base/cc_export.h" |
| 15 #include "cc/debug/rendering_stats_instrumentation.h" | 15 #include "cc/debug/rendering_stats_instrumentation.h" |
| 16 #include "cc/resources/picture_pile_base.h" | 16 #include "cc/resources/picture_pile.h" |
| 17 #include "cc/resources/raster_source.h" | 17 #include "cc/resources/raster_source.h" |
| 18 #include "skia/ext/analysis_canvas.h" | 18 #include "skia/ext/analysis_canvas.h" |
| 19 #include "skia/ext/refptr.h" | 19 #include "skia/ext/refptr.h" |
| 20 #include "third_party/skia/include/core/SkPicture.h" | 20 #include "third_party/skia/include/core/SkPicture.h" |
| 21 | 21 |
| 22 namespace cc { | 22 namespace cc { |
| 23 | 23 |
| 24 // TODO(vmpstr): Clean up PicturePileBase and make it a member. | |
| 25 class CC_EXPORT PicturePileImpl : public RasterSource { | 24 class CC_EXPORT PicturePileImpl : public RasterSource { |
| 26 public: | 25 public: |
| 27 static scoped_refptr<PicturePileImpl> Create(); | 26 static scoped_refptr<PicturePileImpl> Create(); |
| 28 static scoped_refptr<PicturePileImpl> CreateFromOther( | |
|
danakj
2014/11/12 19:56:38
Can we be consistent about using Create() vs const
hendrikw
2014/11/12 20:25:42
Acknowledged.
| |
| 29 const PicturePileBase* other); | |
| 30 | 27 |
| 31 // RasterSource overrides. See RasterSource header for full description. | 28 // RasterSource overrides. See RasterSource header for full description. |
| 32 // When slow-down-raster-scale-factor is set to a value greater than 1, the | 29 // When slow-down-raster-scale-factor is set to a value greater than 1, the |
| 33 // reported rasterize time (in stats_instrumentation) is the minimum measured | 30 // reported rasterize time (in stats_instrumentation) is the minimum measured |
| 34 // value over all runs. | 31 // value over all runs. |
| 35 void PlaybackToCanvas(SkCanvas* canvas, | 32 void PlaybackToCanvas(SkCanvas* canvas, |
| 36 const gfx::Rect& canvas_rect, | 33 const gfx::Rect& canvas_rect, |
| 37 float contents_scale) const override; | 34 float contents_scale) const override; |
| 38 void PlaybackToSharedCanvas(SkCanvas* canvas, | 35 void PlaybackToSharedCanvas(SkCanvas* canvas, |
| 39 const gfx::Rect& canvas_rect, | 36 const gfx::Rect& canvas_rect, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 gfx::Rect layer_rect_; | 78 gfx::Rect layer_rect_; |
| 82 TilingData::Iterator tile_iterator_; | 79 TilingData::Iterator tile_iterator_; |
| 83 Picture::PixelRefIterator pixel_ref_iterator_; | 80 Picture::PixelRefIterator pixel_ref_iterator_; |
| 84 std::set<const void*> processed_pictures_; | 81 std::set<const void*> processed_pictures_; |
| 85 }; | 82 }; |
| 86 | 83 |
| 87 protected: | 84 protected: |
| 88 friend class PicturePile; | 85 friend class PicturePile; |
| 89 friend class PixelRefIterator; | 86 friend class PixelRefIterator; |
| 90 | 87 |
| 91 // TODO(vmpstr): Change this when pictures are split from invalidation info, | 88 // TODO(vmpstr): Change this when pictures are split from invalidation info. |
| 92 // and when PicturePileBase goes away. | 89 using PictureMapKey = PicturePile::PictureMapKey; |
| 93 using PictureMapKey = PicturePileBase::PictureMapKey; | 90 using PictureMap = PicturePile::PictureMap; |
| 94 using PictureMap = PicturePileBase::PictureMap; | 91 using PictureInfo = PicturePile::PictureInfo; |
| 95 using PictureInfo = PicturePileBase::PictureInfo; | |
| 96 | 92 |
| 97 PicturePileImpl(); | 93 PicturePileImpl(); |
| 98 explicit PicturePileImpl(const PicturePileBase* other); | 94 explicit PicturePileImpl(const PicturePile* other); |
| 99 ~PicturePileImpl() override; | 95 ~PicturePileImpl() override; |
| 100 | 96 |
| 101 int buffer_pixels() const { return tiling_.border_texels(); } | 97 int buffer_pixels() const { return tiling_.border_texels(); } |
| 102 | 98 |
| 103 PictureMap picture_map_; | 99 PictureMap picture_map_; |
| 104 TilingData tiling_; | 100 TilingData tiling_; |
| 105 SkColor background_color_; | 101 SkColor background_color_; |
| 106 bool contents_opaque_; | 102 bool contents_opaque_; |
| 107 bool contents_fill_bounds_completely_; | 103 bool contents_fill_bounds_completely_; |
| 108 bool is_solid_color_; | 104 bool is_solid_color_; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 gfx::Rect PaddedRect(const PictureMapKey& key) const; | 138 gfx::Rect PaddedRect(const PictureMapKey& key) const; |
| 143 | 139 |
| 144 bool should_attempt_to_use_distance_field_text_; | 140 bool should_attempt_to_use_distance_field_text_; |
| 145 | 141 |
| 146 DISALLOW_COPY_AND_ASSIGN(PicturePileImpl); | 142 DISALLOW_COPY_AND_ASSIGN(PicturePileImpl); |
| 147 }; | 143 }; |
| 148 | 144 |
| 149 } // namespace cc | 145 } // namespace cc |
| 150 | 146 |
| 151 #endif // CC_RESOURCES_PICTURE_PILE_IMPL_H_ | 147 #endif // CC_RESOURCES_PICTURE_PILE_IMPL_H_ |
| OLD | NEW |