summaryrefslogtreecommitdiffstats
path: root/cc/layers/delegated_renderer_layer_impl.h
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-18 09:05:52 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-18 09:05:52 +0000
commitcc3cfaa706818aee30e0a766f3d4ffe90301ae33 (patch)
tree88d184f795b3790c45c2806306fd5d22d91f6b04 /cc/layers/delegated_renderer_layer_impl.h
parent97ebdbacab06587dd1c8fbdd5cc52f58db5042ab (diff)
downloadchromium_src-cc3cfaa706818aee30e0a766f3d4ffe90301ae33.zip
chromium_src-cc3cfaa706818aee30e0a766f3d4ffe90301ae33.tar.gz
chromium_src-cc3cfaa706818aee30e0a766f3d4ffe90301ae33.tar.bz2
Part 10 of cc/ directory shuffles: layers
Continuation of https://src.chromium.org/viewvc/chrome?view=rev&revision=188681 BUG=190824 TBR=enne@chromium.org, piman@chromium.org, jschuh@chromium.org, joth@chromium.org Review URL: https://codereview.chromium.org/12916002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188703 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layers/delegated_renderer_layer_impl.h')
-rw-r--r--cc/layers/delegated_renderer_layer_impl.h89
1 files changed, 89 insertions, 0 deletions
diff --git a/cc/layers/delegated_renderer_layer_impl.h b/cc/layers/delegated_renderer_layer_impl.h
new file mode 100644
index 0000000..1f6e214
--- /dev/null
+++ b/cc/layers/delegated_renderer_layer_impl.h
@@ -0,0 +1,89 @@
+// 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 CC_LAYERS_DELEGATED_RENDERER_LAYER_IMPL_H_
+#define CC_LAYERS_DELEGATED_RENDERER_LAYER_IMPL_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "cc/base/cc_export.h"
+#include "cc/base/scoped_ptr_vector.h"
+#include "cc/layers/layer_impl.h"
+
+namespace cc {
+class DelegatedFrameData;
+
+class CC_EXPORT DelegatedRendererLayerImpl : public LayerImpl {
+ public:
+ static scoped_ptr<DelegatedRendererLayerImpl> Create(
+ LayerTreeImpl* tree_impl, int id) {
+ return make_scoped_ptr(new DelegatedRendererLayerImpl(tree_impl, id));
+ }
+ virtual ~DelegatedRendererLayerImpl();
+
+ // LayerImpl overrides.
+ virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl*) OVERRIDE;
+ virtual bool HasDelegatedContent() const OVERRIDE;
+ virtual bool HasContributingDelegatedRenderPasses() const OVERRIDE;
+ virtual RenderPass::Id FirstContributingRenderPassId() const OVERRIDE;
+ virtual RenderPass::Id NextContributingRenderPassId(
+ RenderPass::Id previous) const OVERRIDE;
+ virtual void DidLoseOutputSurface() OVERRIDE;
+ virtual void AppendQuads(QuadSink* quad_sink,
+ AppendQuadsData* append_quads_data) OVERRIDE;
+
+ void AppendContributingRenderPasses(RenderPassSink* render_pass_sink);
+
+ void SetFrameData(scoped_ptr<DelegatedFrameData> frame_data,
+ gfx::RectF damage_in_frame,
+ TransferableResourceArray* resources_for_ack);
+
+ void SetDisplaySize(gfx::Size size);
+
+ protected:
+ DelegatedRendererLayerImpl(LayerTreeImpl* tree_impl, int id);
+
+ int ChildIdForTesting() const { return child_id_; }
+ const ScopedPtrVector<RenderPass>& RenderPassesInDrawOrderForTesting() const {
+ return render_passes_in_draw_order_;
+ }
+ const ResourceProvider::ResourceIdSet& ResourcesForTesting() const {
+ return resources_;
+ }
+
+ private:
+ // Creates an ID with the resource provider for the child renderer
+ // that will be sending quads to the layer.
+ void CreateChildIdIfNeeded();
+ void ClearChildId();
+
+ void SetRenderPasses(
+ ScopedPtrVector<RenderPass>* render_passes_in_draw_order);
+ void ClearRenderPasses();
+
+ RenderPass::Id ConvertDelegatedRenderPassId(
+ RenderPass::Id delegated_render_pass_id) const;
+
+ gfx::Transform DelegatedFrameToLayerSpaceTransform(gfx::Size frame_size)
+ const;
+
+ void AppendRenderPassQuads(
+ QuadSink* quad_sink,
+ AppendQuadsData* append_quads_data,
+ const RenderPass* delegated_render_pass,
+ gfx::Size frame_size) const;
+
+ // LayerImpl overrides.
+ virtual const char* LayerTypeAsString() const OVERRIDE;
+
+ ScopedPtrVector<RenderPass> render_passes_in_draw_order_;
+ base::hash_map<RenderPass::Id, int> render_passes_index_by_id_;
+ ResourceProvider::ResourceIdSet resources_;
+
+ gfx::Size display_size_;
+ int child_id_;
+};
+
+}
+
+#endif // CC_LAYERS_DELEGATED_RENDERER_LAYER_IMPL_H_