Chromium Code Reviews| 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 void setRenderPasses(ScopedPtrVector<RenderPass>&); |
| 24 void clearRenderPasses(); | 24 void clearRenderPasses(); |
| 25 | 25 |
| 26 // Set the size at which the frame should be displayed, with the origin at t he layer's origin. | |
| 27 // This must always contain at least the layer's bounds. A value of (0, 0) i mplies that the | |
| 28 // frame should be displayed to fit exactly in the layer's bounds. | |
| 29 void setDisplaySize(gfx::Size displaySize) { m_displaySize = displaySize; } | |
|
piman
2013/01/19 02:02:47
You need a way to set this from the main thread :)
danakj
2013/01/19 02:10:26
Ya, setting the frames as well. I thought I'd leav
| |
| 30 | |
| 26 virtual void didLoseOutputSurface() OVERRIDE; | 31 virtual void didLoseOutputSurface() OVERRIDE; |
| 27 | 32 |
| 28 virtual RenderPass::Id firstContributingRenderPassId() const OVERRIDE; | 33 virtual RenderPass::Id firstContributingRenderPassId() const OVERRIDE; |
| 29 virtual RenderPass::Id nextContributingRenderPassId(RenderPass::Id) const OV ERRIDE; | 34 virtual RenderPass::Id nextContributingRenderPassId(RenderPass::Id) const OV ERRIDE; |
| 30 | 35 |
| 31 void appendContributingRenderPasses(RenderPassSink&); | 36 void appendContributingRenderPasses(RenderPassSink&); |
| 32 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; | 37 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; |
| 33 | 38 |
| 34 private: | 39 private: |
| 35 DelegatedRendererLayerImpl(LayerTreeImpl* treeImpl, int id); | 40 DelegatedRendererLayerImpl(LayerTreeImpl* treeImpl, int id); |
| 36 | 41 |
| 37 RenderPass::Id convertDelegatedRenderPassId(RenderPass::Id delegatedRenderPa ssId) const; | 42 RenderPass::Id convertDelegatedRenderPassId(RenderPass::Id delegatedRenderPa ssId) const; |
| 38 | 43 |
| 39 void appendRenderPassQuads(QuadSink&, AppendQuadsData&, const RenderPass* fr omDelegatedRenderPass) const; | 44 void appendRenderPassQuads(QuadSink&, AppendQuadsData&, const RenderPass* fr omDelegatedRenderPass, gfx::Size frameSize) const; |
| 40 | 45 |
| 41 virtual const char* layerTypeAsString() const OVERRIDE; | 46 virtual const char* layerTypeAsString() const OVERRIDE; |
| 42 | 47 |
| 43 ScopedPtrVector<RenderPass> m_renderPassesInDrawOrder; | 48 ScopedPtrVector<RenderPass> m_renderPassesInDrawOrder; |
| 44 base::hash_map<RenderPass::Id, int> m_renderPassesIndexById; | 49 base::hash_map<RenderPass::Id, int> m_renderPassesIndexById; |
| 50 gfx::Size m_displaySize; | |
| 45 }; | 51 }; |
| 46 | 52 |
| 47 } | 53 } |
| 48 | 54 |
| 49 #endif // CC_DELEGATED_RENDERER_LAYER_IMPL_H_ | 55 #endif // CC_DELEGATED_RENDERER_LAYER_IMPL_H_ |
| OLD | NEW |