| 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( |   27   static scoped_refptr<PicturePileImpl> CreateFromPicturePile( | 
|   29       const PicturePileBase* other); |   28       const PicturePile* other); | 
|   30  |   29  | 
|   31   // RasterSource overrides. See RasterSource header for full description. |   30   // RasterSource overrides. See RasterSource header for full description. | 
|   32   // When slow-down-raster-scale-factor is set to a value greater than 1, the |   31   // 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 |   32   // reported rasterize time (in stats_instrumentation) is the minimum measured | 
|   34   // value over all runs. |   33   // value over all runs. | 
|   35   void PlaybackToCanvas(SkCanvas* canvas, |   34   void PlaybackToCanvas(SkCanvas* canvas, | 
|   36                         const gfx::Rect& canvas_rect, |   35                         const gfx::Rect& canvas_rect, | 
|   37                         float contents_scale) const override; |   36                         float contents_scale) const override; | 
|   38   void PlaybackToSharedCanvas(SkCanvas* canvas, |   37   void PlaybackToSharedCanvas(SkCanvas* canvas, | 
|   39                               const gfx::Rect& canvas_rect, |   38                               const gfx::Rect& canvas_rect, | 
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   81     gfx::Rect layer_rect_; |   80     gfx::Rect layer_rect_; | 
|   82     TilingData::Iterator tile_iterator_; |   81     TilingData::Iterator tile_iterator_; | 
|   83     Picture::PixelRefIterator pixel_ref_iterator_; |   82     Picture::PixelRefIterator pixel_ref_iterator_; | 
|   84     std::set<const void*> processed_pictures_; |   83     std::set<const void*> processed_pictures_; | 
|   85   }; |   84   }; | 
|   86  |   85  | 
|   87  protected: |   86  protected: | 
|   88   friend class PicturePile; |   87   friend class PicturePile; | 
|   89   friend class PixelRefIterator; |   88   friend class PixelRefIterator; | 
|   90  |   89  | 
|   91   // TODO(vmpstr): Change this when pictures are split from invalidation info, |   90   // TODO(vmpstr): Change this when pictures are split from invalidation info. | 
|   92   // and when PicturePileBase goes away. |   91   using PictureMapKey = PicturePile::PictureMapKey; | 
|   93   using PictureMapKey = PicturePileBase::PictureMapKey; |   92   using PictureMap = PicturePile::PictureMap; | 
|   94   using PictureMap = PicturePileBase::PictureMap; |   93   using PictureInfo = PicturePile::PictureInfo; | 
|   95   using PictureInfo = PicturePileBase::PictureInfo; |  | 
|   96  |   94  | 
|   97   PicturePileImpl(); |   95   PicturePileImpl(); | 
|   98   explicit PicturePileImpl(const PicturePileBase* other); |   96   explicit PicturePileImpl(const PicturePile* other); | 
|   99   ~PicturePileImpl() override; |   97   ~PicturePileImpl() override; | 
|  100  |   98  | 
|  101   int buffer_pixels() const { return tiling_.border_texels(); } |   99   int buffer_pixels() const { return tiling_.border_texels(); } | 
|  102  |  100  | 
|  103   PictureMap picture_map_; |  101   PictureMap picture_map_; | 
|  104   TilingData tiling_; |  102   TilingData tiling_; | 
|  105   SkColor background_color_; |  103   SkColor background_color_; | 
|  106   bool contents_opaque_; |  104   bool contents_opaque_; | 
|  107   bool contents_fill_bounds_completely_; |  105   bool contents_fill_bounds_completely_; | 
|  108   bool is_solid_color_; |  106   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; |  140   gfx::Rect PaddedRect(const PictureMapKey& key) const; | 
|  143  |  141  | 
|  144   bool should_attempt_to_use_distance_field_text_; |  142   bool should_attempt_to_use_distance_field_text_; | 
|  145  |  143  | 
|  146   DISALLOW_COPY_AND_ASSIGN(PicturePileImpl); |  144   DISALLOW_COPY_AND_ASSIGN(PicturePileImpl); | 
|  147 }; |  145 }; | 
|  148  |  146  | 
|  149 }  // namespace cc |  147 }  // namespace cc | 
|  150  |  148  | 
|  151 #endif  // CC_RESOURCES_PICTURE_PILE_IMPL_H_ |  149 #endif  // CC_RESOURCES_PICTURE_PILE_IMPL_H_ | 
| OLD | NEW |