Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: cc/layers/delegated_renderer_layer.h

Issue 23097005: cc: return resources via a ReturnedResource struct rather than TransferableResource (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review nits Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/cc.gyp ('k') | cc/layers/delegated_renderer_layer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "cc/base/cc_export.h" 8 #include "cc/base/cc_export.h"
9 #include "cc/layers/layer.h" 9 #include "cc/layers/layer.h"
10 #include "cc/resources/transferable_resource.h" 10 #include "cc/resources/returned_resource.h"
11 11
12 namespace cc { 12 namespace cc {
13 13
14 class DelegatedFrameData; 14 class DelegatedFrameData;
15 class DelegatedRendererLayerClient; 15 class DelegatedRendererLayerClient;
16 16
17 class CC_EXPORT DelegatedRendererLayer : public Layer { 17 class CC_EXPORT DelegatedRendererLayer : public Layer {
18 public: 18 public:
19 static scoped_refptr<DelegatedRendererLayer> Create( 19 static scoped_refptr<DelegatedRendererLayer> Create(
20 DelegatedRendererLayerClient* client); 20 DelegatedRendererLayerClient* client);
21 21
22 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) 22 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
23 OVERRIDE; 23 OVERRIDE;
24 virtual void PushPropertiesTo(LayerImpl* impl) OVERRIDE; 24 virtual void PushPropertiesTo(LayerImpl* impl) OVERRIDE;
25 virtual bool DrawsContent() const OVERRIDE; 25 virtual bool DrawsContent() const OVERRIDE;
26 26
27 // Set the size at which the frame should be displayed, with the origin at the 27 // Set the size at which the frame should be displayed, with the origin at the
28 // layer's origin. This must always contain at least the layer's bounds. A 28 // layer's origin. This must always contain at least the layer's bounds. A
29 // value of (0, 0) implies that the frame should be displayed to fit exactly 29 // value of (0, 0) implies that the frame should be displayed to fit exactly
30 // in the layer's bounds. 30 // in the layer's bounds.
31 void SetDisplaySize(gfx::Size size); 31 void SetDisplaySize(gfx::Size size);
32 32
33 void SetFrameData(scoped_ptr<DelegatedFrameData> frame_data); 33 void SetFrameData(scoped_ptr<DelegatedFrameData> frame_data);
34 34
35 // Passes ownership of any unused resources that had been given by the child 35 // Passes ownership of any unused resources that had been given by the child
36 // compositor to the given array, so they can be given back to the child. 36 // compositor to the given array, so they can be given back to the child.
37 void TakeUnusedResourcesForChildCompositor(TransferableResourceArray* array); 37 void TakeUnusedResourcesForChildCompositor(ReturnedResourceArray* array);
38 38
39 virtual bool BlocksPendingCommit() const OVERRIDE; 39 virtual bool BlocksPendingCommit() const OVERRIDE;
40 40
41 protected: 41 protected:
42 explicit DelegatedRendererLayer(DelegatedRendererLayerClient* client); 42 explicit DelegatedRendererLayer(DelegatedRendererLayerClient* client);
43 virtual ~DelegatedRendererLayer(); 43 virtual ~DelegatedRendererLayer();
44 44
45 private: 45 private:
46 scoped_ptr<DelegatedFrameData> frame_data_; 46 scoped_ptr<DelegatedFrameData> frame_data_;
47 gfx::RectF damage_in_frame_; 47 gfx::RectF damage_in_frame_;
48 gfx::Size frame_size_; 48 gfx::Size frame_size_;
49 gfx::Size display_size_; 49 gfx::Size display_size_;
50 TransferableResourceArray unused_resources_for_child_compositor_; 50 ReturnedResourceArray unused_resources_for_child_compositor_;
51 51
52 DelegatedRendererLayerClient* client_; 52 DelegatedRendererLayerClient* client_;
53 53
54 DISALLOW_COPY_AND_ASSIGN(DelegatedRendererLayer); 54 DISALLOW_COPY_AND_ASSIGN(DelegatedRendererLayer);
55 }; 55 };
56 56
57 } // namespace cc 57 } // namespace cc
58 #endif // CC_LAYERS_DELEGATED_RENDERER_LAYER_H_ 58 #endif // CC_LAYERS_DELEGATED_RENDERER_LAYER_H_
OLDNEW
« no previous file with comments | « cc/cc.gyp ('k') | cc/layers/delegated_renderer_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698