// Copyright 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CCDelegatedRendererLayerImpl_h #define CCDelegatedRendererLayerImpl_h #include "CCLayerImpl.h" #include "cc/scoped_ptr_vector.h" namespace cc { class CCDelegatedRendererLayerImpl : public CCLayerImpl { public: static scoped_ptr create(int id) { return make_scoped_ptr(new CCDelegatedRendererLayerImpl(id)); } virtual ~CCDelegatedRendererLayerImpl(); virtual bool descendantDrawsContent() OVERRIDE; virtual bool hasContributingDelegatedRenderPasses() const OVERRIDE; // This gives ownership of the RenderPasses to the layer. void setRenderPasses(ScopedPtrVector&); void clearRenderPasses(); virtual void didLoseContext() OVERRIDE; virtual CCRenderPass::Id firstContributingRenderPassId() const OVERRIDE; virtual CCRenderPass::Id nextContributingRenderPassId(CCRenderPass::Id) const OVERRIDE; void appendContributingRenderPasses(CCRenderPassSink&); virtual void appendQuads(CCQuadSink&, CCAppendQuadsData&) OVERRIDE; private: explicit CCDelegatedRendererLayerImpl(int); CCRenderPass::Id convertDelegatedRenderPassId(CCRenderPass::Id delegatedRenderPassId) const; void appendRenderPassQuads(CCQuadSink&, CCAppendQuadsData&, CCRenderPass* fromDelegatedRenderPass) const; PassOwnPtr createCopyOfQuad(const CCDrawQuad*); virtual const char* layerTypeAsString() const OVERRIDE; ScopedPtrVector m_renderPassesInDrawOrder; base::hash_map m_renderPassesIndexById; }; } #endif // CCDelegatedRendererLayerImpl_h