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_DELEGATED_RENDERER_LAYER_IMPL_H_ | 5 #ifndef CC_DELEGATED_RENDERER_LAYER_IMPL_H_ |
6 #define CC_DELEGATED_RENDERER_LAYER_IMPL_H_ | 6 #define CC_DELEGATED_RENDERER_LAYER_IMPL_H_ |
7 | 7 |
8 #include "cc/cc_export.h" | 8 #include "cc/cc_export.h" |
9 #include "cc/layer_impl.h" | 9 #include "cc/layer_impl.h" |
10 #include "cc/scoped_ptr_vector.h" | 10 #include "cc/scoped_ptr_vector.h" |
11 | 11 |
12 namespace cc { | 12 namespace cc { |
13 | 13 |
14 class CC_EXPORT DelegatedRendererLayerImpl : public LayerImpl { | 14 class CC_EXPORT DelegatedRendererLayerImpl : public LayerImpl { |
15 public: | 15 public: |
16 static scoped_ptr<DelegatedRendererLayerImpl> create(LayerTreeImpl* treeImpl , int id) { return make_scoped_ptr(new DelegatedRendererLayerImpl(treeImpl, id)) ; } | 16 static scoped_ptr<DelegatedRendererLayerImpl> create(LayerTreeImpl* treeImpl , int id) { return make_scoped_ptr(new DelegatedRendererLayerImpl(treeImpl, id)) ; } |
17 virtual ~DelegatedRendererLayerImpl(); | 17 virtual ~DelegatedRendererLayerImpl(); |
18 | 18 |
19 virtual bool hasDelegatedContent() const OVERRIDE; | 19 virtual bool hasDelegatedContent() const OVERRIDE; |
20 virtual bool hasContributingDelegatedRenderPasses() const OVERRIDE; | 20 virtual bool hasContributingDelegatedRenderPasses() const OVERRIDE; |
21 | 21 |
22 // This gives ownership of the RenderPasses to the layer. | 22 // This gives ownership of the RenderPasses to the layer. |
23 void setRenderPasses(ScopedPtrVector<RenderPass>&); | 23 // The render passes belong to a frame with bounds |frameSize|, and the |
24 // entire frame will be drawn into layer space of this layer, scaled to fill | |
25 // the bounds of the layer. | |
26 void setRenderPasses(ScopedPtrVector<RenderPass>&, gfx::Size frameSize); | |
24 void clearRenderPasses(); | 27 void clearRenderPasses(); |
25 | 28 |
26 virtual void didLoseOutputSurface() OVERRIDE; | 29 virtual void didLoseOutputSurface() OVERRIDE; |
27 | 30 |
28 virtual RenderPass::Id firstContributingRenderPassId() const OVERRIDE; | 31 virtual RenderPass::Id firstContributingRenderPassId() const OVERRIDE; |
29 virtual RenderPass::Id nextContributingRenderPassId(RenderPass::Id) const OV ERRIDE; | 32 virtual RenderPass::Id nextContributingRenderPassId(RenderPass::Id) const OV ERRIDE; |
30 | 33 |
31 void appendContributingRenderPasses(RenderPassSink&); | 34 void appendContributingRenderPasses(RenderPassSink&); |
32 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; | 35 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; |
33 | 36 |
34 private: | 37 private: |
35 DelegatedRendererLayerImpl(LayerTreeImpl* treeImpl, int id); | 38 DelegatedRendererLayerImpl(LayerTreeImpl* treeImpl, int id); |
36 | 39 |
37 RenderPass::Id convertDelegatedRenderPassId(RenderPass::Id delegatedRenderPa ssId) const; | 40 RenderPass::Id convertDelegatedRenderPassId(RenderPass::Id delegatedRenderPa ssId) const; |
38 | 41 |
39 void appendRenderPassQuads(QuadSink&, AppendQuadsData&, const RenderPass* fr omDelegatedRenderPass) const; | 42 void appendRenderPassQuads(QuadSink&, AppendQuadsData&, const RenderPass* fr omDelegatedRenderPass) const; |
40 | 43 |
41 virtual const char* layerTypeAsString() const OVERRIDE; | 44 virtual const char* layerTypeAsString() const OVERRIDE; |
42 | 45 |
43 ScopedPtrVector<RenderPass> m_renderPassesInDrawOrder; | 46 ScopedPtrVector<RenderPass> m_renderPassesInDrawOrder; |
44 base::hash_map<RenderPass::Id, int> m_renderPassesIndexById; | 47 base::hash_map<RenderPass::Id, int> m_renderPassesIndexById; |
48 gfx::Size m_frameSize; | |
enne (OOO)
2013/01/09 02:48:20
Is this redundant with the root render pass's outp
enne (OOO)
2013/01/09 02:48:20
Is this redundant with the root render pass's outp
danakj
2013/01/09 02:55:49
Ya I totally think so. We don't need the size on t
| |
49 gfx::Size m_desiredLayerDisplaySize; | |
45 }; | 50 }; |
46 | 51 |
47 } | 52 } |
48 | 53 |
49 #endif // CC_DELEGATED_RENDERER_LAYER_IMPL_H_ | 54 #endif // CC_DELEGATED_RENDERER_LAYER_IMPL_H_ |
OLD | NEW |