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/synchronization/lock.h" |
8 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
9 #include "cc/layers/layer.h" | 10 #include "cc/layers/layer.h" |
10 #include "cc/resources/returned_resource.h" | 11 #include "cc/resources/returned_resource.h" |
11 | 12 |
12 namespace cc { | 13 namespace cc { |
13 | 14 |
14 class DelegatedFrameData; | 15 class DelegatedFrameData; |
15 class DelegatedRendererLayerClient; | 16 class DelegatedRendererLayerClient; |
16 | 17 |
17 class CC_EXPORT DelegatedRendererLayer : public Layer { | 18 class CC_EXPORT DelegatedRendererLayer : public Layer { |
(...skipping 17 matching lines...) Expand all Loading... |
35 | 36 |
36 // Passes ownership of any unused resources that had been given by the child | 37 // Passes ownership of any unused resources that had been given by the child |
37 // compositor to the given array, so they can be given back to the child. | 38 // compositor to the given array, so they can be given back to the child. |
38 void TakeUnusedResourcesForChildCompositor(ReturnedResourceArray* array); | 39 void TakeUnusedResourcesForChildCompositor(ReturnedResourceArray* array); |
39 | 40 |
40 protected: | 41 protected: |
41 explicit DelegatedRendererLayer(DelegatedRendererLayerClient* client); | 42 explicit DelegatedRendererLayer(DelegatedRendererLayerClient* client); |
42 virtual ~DelegatedRendererLayer(); | 43 virtual ~DelegatedRendererLayer(); |
43 | 44 |
44 private: | 45 private: |
| 46 void ReceiveUnusedResources(const ReturnedResourceArray& unused); |
| 47 |
45 scoped_ptr<DelegatedFrameData> frame_data_; | 48 scoped_ptr<DelegatedFrameData> frame_data_; |
46 gfx::RectF damage_in_frame_; | 49 gfx::RectF damage_in_frame_; |
47 gfx::Size frame_size_; | 50 gfx::Size frame_size_; |
48 gfx::Size display_size_; | 51 gfx::Size display_size_; |
49 ReturnedResourceArray unused_resources_for_child_compositor_; | |
50 | 52 |
51 DelegatedRendererLayerClient* client_; | 53 DelegatedRendererLayerClient* client_; |
52 bool needs_filter_context_; | 54 bool needs_filter_context_; |
53 | 55 |
| 56 base::Lock unused_resources_lock_; |
| 57 ReturnedResourceArray unused_resources_for_child_compositor_; |
| 58 |
54 DISALLOW_COPY_AND_ASSIGN(DelegatedRendererLayer); | 59 DISALLOW_COPY_AND_ASSIGN(DelegatedRendererLayer); |
55 }; | 60 }; |
56 | 61 |
57 } // namespace cc | 62 } // namespace cc |
| 63 |
58 #endif // CC_LAYERS_DELEGATED_RENDERER_LAYER_H_ | 64 #endif // CC_LAYERS_DELEGATED_RENDERER_LAYER_H_ |
OLD | NEW |