| 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_LAYERS_PICTURE_LAYER_IMPL_H_ | 5 #ifndef CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
| 6 #define CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 6 #define CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "cc/base/cc_export.h" | 12 #include "cc/base/cc_export.h" |
| 13 #include "cc/base/scoped_ptr_vector.h" | 13 #include "cc/base/scoped_ptr_vector.h" |
| 14 #include "cc/layers/layer_impl.h" | 14 #include "cc/layers/layer_impl.h" |
| 15 #include "cc/resources/picture_layer_tiling.h" | 15 #include "cc/resources/picture_layer_tiling.h" |
| 16 #include "cc/resources/picture_layer_tiling_set.h" | 16 #include "cc/resources/picture_layer_tiling_set.h" |
| 17 #include "cc/resources/picture_pile_impl.h" | 17 #include "cc/resources/picture_pile_impl.h" |
| 18 #include "cc/resources/tiling_set_eviction_queue.h" | 18 #include "cc/resources/tiling_set_eviction_queue.h" |
| 19 #include "cc/resources/tiling_set_raster_queue.h" | |
| 20 #include "skia/ext/refptr.h" | 19 #include "skia/ext/refptr.h" |
| 21 #include "third_party/skia/include/core/SkPicture.h" | 20 #include "third_party/skia/include/core/SkPicture.h" |
| 22 | 21 |
| 23 namespace cc { | 22 namespace cc { |
| 24 | 23 |
| 25 struct AppendQuadsData; | 24 struct AppendQuadsData; |
| 26 class MicroBenchmarkImpl; | 25 class MicroBenchmarkImpl; |
| 27 class Tile; | 26 class Tile; |
| 28 | 27 |
| 29 class CC_EXPORT PictureLayerImpl | 28 class CC_EXPORT PictureLayerImpl |
| (...skipping 11 matching lines...) Expand all Loading... |
| 41 | 40 |
| 42 static scoped_ptr<PictureLayerImpl> Create(LayerTreeImpl* tree_impl, | 41 static scoped_ptr<PictureLayerImpl> Create(LayerTreeImpl* tree_impl, |
| 43 int id, | 42 int id, |
| 44 bool is_mask) { | 43 bool is_mask) { |
| 45 return make_scoped_ptr(new PictureLayerImpl(tree_impl, id, is_mask)); | 44 return make_scoped_ptr(new PictureLayerImpl(tree_impl, id, is_mask)); |
| 46 } | 45 } |
| 47 ~PictureLayerImpl() override; | 46 ~PictureLayerImpl() override; |
| 48 | 47 |
| 49 bool is_mask() const { return is_mask_; } | 48 bool is_mask() const { return is_mask_; } |
| 50 | 49 |
| 51 scoped_ptr<TilingSetEvictionQueue> CreateEvictionQueue( | |
| 52 TreePriority tree_priority); | |
| 53 scoped_ptr<TilingSetRasterQueue> CreateRasterQueue(bool prioritize_low_res); | |
| 54 | |
| 55 // LayerImpl overrides. | 50 // LayerImpl overrides. |
| 56 const char* LayerTypeAsString() const override; | 51 const char* LayerTypeAsString() const override; |
| 57 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; | 52 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
| 58 void PushPropertiesTo(LayerImpl* layer) override; | 53 void PushPropertiesTo(LayerImpl* layer) override; |
| 59 void AppendQuads(RenderPass* render_pass, | 54 void AppendQuads(RenderPass* render_pass, |
| 60 const Occlusion& occlusion_in_content_space, | 55 const Occlusion& occlusion_in_content_space, |
| 61 AppendQuadsData* append_quads_data) override; | 56 AppendQuadsData* append_quads_data) override; |
| 62 bool UpdateTiles(const Occlusion& occlusion_in_content_space, | 57 bool UpdateTiles(const Occlusion& occlusion_in_content_space, |
| 63 bool resourceless_software_draw) override; | 58 bool resourceless_software_draw) override; |
| 64 void NotifyTileStateChanged(const Tile* tile) override; | 59 void NotifyTileStateChanged(const Tile* tile) override; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 88 gfx::Size* resource_size) const override; | 83 gfx::Size* resource_size) const override; |
| 89 | 84 |
| 90 void SetNearestNeighbor(bool nearest_neighbor); | 85 void SetNearestNeighbor(bool nearest_neighbor); |
| 91 | 86 |
| 92 size_t GPUMemoryUsageInBytes() const override; | 87 size_t GPUMemoryUsageInBytes() const override; |
| 93 | 88 |
| 94 void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) override; | 89 void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) override; |
| 95 | 90 |
| 96 bool CanHaveTilings() const; | 91 bool CanHaveTilings() const; |
| 97 | 92 |
| 93 PictureLayerTilingSet* picture_layer_tiling_set() { return tilings_.get(); } |
| 94 |
| 98 // Functions used by tile manager. | 95 // Functions used by tile manager. |
| 99 PictureLayerImpl* GetPendingOrActiveTwinLayer() const; | 96 PictureLayerImpl* GetPendingOrActiveTwinLayer() const; |
| 100 bool IsOnActiveOrPendingTree() const; | 97 bool IsOnActiveOrPendingTree() const; |
| 101 // Virtual for testing. | 98 // Virtual for testing. |
| 102 virtual bool HasValidTilePriorities() const; | 99 virtual bool HasValidTilePriorities() const; |
| 103 bool AllTilesRequiredForActivationAreReadyToDraw() const; | 100 bool AllTilesRequiredForActivationAreReadyToDraw() const; |
| 104 bool AllTilesRequiredForDrawAreReadyToDraw() const; | 101 bool AllTilesRequiredForDrawAreReadyToDraw() const; |
| 105 | 102 |
| 106 // Used for benchmarking | 103 // Used for benchmarking |
| 107 RasterSource* GetRasterSource() const { return raster_source_.get(); } | 104 RasterSource* GetRasterSource() const { return raster_source_.get(); } |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 // from regular draws. Save a copy of the required draw properties of the last | 173 // from regular draws. Save a copy of the required draw properties of the last |
| 177 // frame that has a valid viewport for prioritizing tiles. | 174 // frame that has a valid viewport for prioritizing tiles. |
| 178 gfx::Rect visible_rect_for_tile_priority_; | 175 gfx::Rect visible_rect_for_tile_priority_; |
| 179 | 176 |
| 180 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 177 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
| 181 }; | 178 }; |
| 182 | 179 |
| 183 } // namespace cc | 180 } // namespace cc |
| 184 | 181 |
| 185 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 182 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
| OLD | NEW |