OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CC_DELEGATED_RENDERER_LAYER_H_ | |
6 #define CC_DELEGATED_RENDERER_LAYER_H_ | |
7 | |
8 #include "cc/base/cc_export.h" | |
9 #include "cc/layer.h" | |
10 #include "cc/resources/transferable_resource.h" | |
11 | |
12 namespace cc { | |
13 class DelegatedFrameData; | |
14 | |
15 class CC_EXPORT DelegatedRendererLayer : public Layer { | |
16 public: | |
17 static scoped_refptr<DelegatedRendererLayer> Create(); | |
18 | |
19 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) | |
20 OVERRIDE; | |
21 virtual void PushPropertiesTo(LayerImpl* impl) OVERRIDE; | |
22 virtual bool DrawsContent() const OVERRIDE; | |
23 | |
24 // Set the size at which the frame should be displayed, with the origin at the | |
25 // layer's origin. This must always contain at least the layer's bounds. A | |
26 // value of (0, 0) implies that the frame should be displayed to fit exactly | |
27 // in the layer's bounds. | |
28 void SetDisplaySize(gfx::Size size); | |
29 | |
30 void SetFrameData(scoped_ptr<DelegatedFrameData> frame_data); | |
31 | |
32 // Passes ownership of any unused resources that had been given by the child | |
33 // compositor to the given array, so they can be given back to the child. | |
34 void TakeUnusedResourcesForChildCompositor(TransferableResourceArray* array); | |
35 | |
36 protected: | |
37 DelegatedRendererLayer(); | |
38 virtual ~DelegatedRendererLayer(); | |
39 | |
40 private: | |
41 scoped_ptr<DelegatedFrameData> frame_data_; | |
42 gfx::RectF damage_in_frame_; | |
43 gfx::Size frame_size_; | |
44 gfx::Size display_size_; | |
45 TransferableResourceArray unused_resources_for_child_compositor_; | |
46 }; | |
47 | |
48 } | |
49 #endif // CC_DELEGATED_RENDERER_LAYER_H_ | |
OLD | NEW |