| 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 13 matching lines...) Expand all Loading... |
| 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( | 50 scoped_ptr<TilingSetEvictionQueue> CreateEvictionQueue( |
| 52 TreePriority tree_priority); | 51 TreePriority tree_priority); |
| 53 scoped_ptr<TilingSetRasterQueue> CreateRasterQueue(bool prioritize_low_res); | |
| 54 | 52 |
| 55 // LayerImpl overrides. | 53 // LayerImpl overrides. |
| 56 const char* LayerTypeAsString() const override; | 54 const char* LayerTypeAsString() const override; |
| 57 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; | 55 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
| 58 void PushPropertiesTo(LayerImpl* layer) override; | 56 void PushPropertiesTo(LayerImpl* layer) override; |
| 59 void AppendQuads(RenderPass* render_pass, | 57 void AppendQuads(RenderPass* render_pass, |
| 60 const Occlusion& occlusion_in_content_space, | 58 const Occlusion& occlusion_in_content_space, |
| 61 AppendQuadsData* append_quads_data) override; | 59 AppendQuadsData* append_quads_data) override; |
| 62 bool UpdateTiles(const Occlusion& occlusion_in_content_space, | 60 bool UpdateTiles(const Occlusion& occlusion_in_content_space, |
| 63 bool resourceless_software_draw) override; | 61 bool resourceless_software_draw) override; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 88 gfx::Size* resource_size) const override; | 86 gfx::Size* resource_size) const override; |
| 89 | 87 |
| 90 void SetNearestNeighbor(bool nearest_neighbor); | 88 void SetNearestNeighbor(bool nearest_neighbor); |
| 91 | 89 |
| 92 size_t GPUMemoryUsageInBytes() const override; | 90 size_t GPUMemoryUsageInBytes() const override; |
| 93 | 91 |
| 94 void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) override; | 92 void RunMicroBenchmark(MicroBenchmarkImpl* benchmark) override; |
| 95 | 93 |
| 96 bool CanHaveTilings() const; | 94 bool CanHaveTilings() const; |
| 97 | 95 |
| 96 PictureLayerTilingSet* picture_layer_tiling_set() { return tilings_.get(); } |
| 97 |
| 98 // Functions used by tile manager. | 98 // Functions used by tile manager. |
| 99 PictureLayerImpl* GetPendingOrActiveTwinLayer() const; | 99 PictureLayerImpl* GetPendingOrActiveTwinLayer() const; |
| 100 bool IsOnActiveOrPendingTree() const; | 100 bool IsOnActiveOrPendingTree() const; |
| 101 // Virtual for testing. | 101 // Virtual for testing. |
| 102 virtual bool HasValidTilePriorities() const; | 102 virtual bool HasValidTilePriorities() const; |
| 103 bool AllTilesRequiredForActivationAreReadyToDraw() const; | 103 bool AllTilesRequiredForActivationAreReadyToDraw() const; |
| 104 bool AllTilesRequiredForDrawAreReadyToDraw() const; | 104 bool AllTilesRequiredForDrawAreReadyToDraw() const; |
| 105 | 105 |
| 106 // Used for benchmarking | 106 // Used for benchmarking |
| 107 RasterSource* GetRasterSource() const { return raster_source_.get(); } | 107 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 | 176 // from regular draws. Save a copy of the required draw properties of the last |
| 177 // frame that has a valid viewport for prioritizing tiles. | 177 // frame that has a valid viewport for prioritizing tiles. |
| 178 gfx::Rect visible_rect_for_tile_priority_; | 178 gfx::Rect visible_rect_for_tile_priority_; |
| 179 | 179 |
| 180 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); | 180 DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); |
| 181 }; | 181 }; |
| 182 | 182 |
| 183 } // namespace cc | 183 } // namespace cc |
| 184 | 184 |
| 185 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ | 185 #endif // CC_LAYERS_PICTURE_LAYER_IMPL_H_ |
| OLD | NEW |