| 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_DELEGATED_RENDERER_LAYER_H_ | 5 #ifndef CC_LAYERS_DELEGATED_RENDERER_LAYER_H_ |
| 6 #define CC_LAYERS_DELEGATED_RENDERER_LAYER_H_ | 6 #define CC_LAYERS_DELEGATED_RENDERER_LAYER_H_ |
| 7 | 7 |
| 8 #include "base/containers/hash_tables.h" | 8 #include "base/containers/hash_tables.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "base/synchronization/lock.h" | 11 #include "base/synchronization/lock.h" |
| 12 #include "cc/base/cc_export.h" | 12 #include "cc/base/cc_export.h" |
| 13 #include "cc/layers/delegated_frame_provider.h" | 13 #include "cc/layers/delegated_frame_provider.h" |
| 14 #include "cc/layers/layer.h" | 14 #include "cc/layers/layer.h" |
| 15 #include "cc/resources/returned_resource.h" | 15 #include "cc/resources/returned_resource.h" |
| 16 | 16 |
| 17 namespace cc { | 17 namespace cc { |
| 18 | 18 |
| 19 class CC_EXPORT DelegatedRendererLayer : public Layer { | 19 class CC_EXPORT DelegatedRendererLayer : public Layer { |
| 20 public: | 20 public: |
| 21 static scoped_refptr<DelegatedRendererLayer> Create( | 21 static scoped_refptr<DelegatedRendererLayer> Create( |
| 22 const scoped_refptr<DelegatedFrameProvider>& frame_provider); | 22 const scoped_refptr<DelegatedFrameProvider>& frame_provider); |
| 23 | 23 |
| 24 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) | 24 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) |
| 25 OVERRIDE; | 25 override; |
| 26 virtual void SetLayerTreeHost(LayerTreeHost* host) OVERRIDE; | 26 virtual void SetLayerTreeHost(LayerTreeHost* host) override; |
| 27 virtual bool Update(ResourceUpdateQueue* queue, | 27 virtual bool Update(ResourceUpdateQueue* queue, |
| 28 const OcclusionTracker<Layer>* occlusion) OVERRIDE; | 28 const OcclusionTracker<Layer>* occlusion) override; |
| 29 virtual void PushPropertiesTo(LayerImpl* impl) OVERRIDE; | 29 virtual void PushPropertiesTo(LayerImpl* impl) override; |
| 30 | 30 |
| 31 // Called by the DelegatedFrameProvider when a new frame is available to be | 31 // Called by the DelegatedFrameProvider when a new frame is available to be |
| 32 // picked up. | 32 // picked up. |
| 33 void ProviderHasNewFrame(); | 33 void ProviderHasNewFrame(); |
| 34 virtual bool HasDelegatedContent() const OVERRIDE; | 34 virtual bool HasDelegatedContent() const override; |
| 35 | 35 |
| 36 protected: | 36 protected: |
| 37 DelegatedRendererLayer( | 37 DelegatedRendererLayer( |
| 38 const scoped_refptr<DelegatedFrameProvider>& frame_provider); | 38 const scoped_refptr<DelegatedFrameProvider>& frame_provider); |
| 39 virtual ~DelegatedRendererLayer(); | 39 virtual ~DelegatedRendererLayer(); |
| 40 | 40 |
| 41 private: | 41 private: |
| 42 scoped_refptr<DelegatedFrameProvider> frame_provider_; | 42 scoped_refptr<DelegatedFrameProvider> frame_provider_; |
| 43 | 43 |
| 44 bool should_collect_new_frame_; | 44 bool should_collect_new_frame_; |
| 45 | 45 |
| 46 DelegatedFrameData* frame_data_; | 46 DelegatedFrameData* frame_data_; |
| 47 gfx::RectF frame_damage_; | 47 gfx::RectF frame_damage_; |
| 48 | 48 |
| 49 base::WeakPtrFactory<DelegatedRendererLayer> weak_ptrs_; | 49 base::WeakPtrFactory<DelegatedRendererLayer> weak_ptrs_; |
| 50 | 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(DelegatedRendererLayer); | 51 DISALLOW_COPY_AND_ASSIGN(DelegatedRendererLayer); |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 } // namespace cc | 54 } // namespace cc |
| 55 | 55 |
| 56 #endif // CC_LAYERS_DELEGATED_RENDERER_LAYER_H_ | 56 #endif // CC_LAYERS_DELEGATED_RENDERER_LAYER_H_ |
| OLD | NEW |