summaryrefslogtreecommitdiffstats
path: root/cc/test/fake_delegated_renderer_layer_impl.cc
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-04 22:28:30 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-04 22:28:30 +0000
commit257492c171bcf774477475468b76b4ec4410a3fb (patch)
tree33227b70953fe5dedb6ab5ee4959e8b0165df0f5 /cc/test/fake_delegated_renderer_layer_impl.cc
parentf4126df56211740e179d466a1a1af61c9002b2fb (diff)
downloadchromium_src-257492c171bcf774477475468b76b4ec4410a3fb.zip
chromium_src-257492c171bcf774477475468b76b4ec4410a3fb.tar.gz
chromium_src-257492c171bcf774477475468b76b4ec4410a3fb.tar.bz2
cc: Make DelegatedRendererLayerImpl::SetRenderPasses() private.
This method was now public only for tests. SetFrameData() should be used instead. Implemented a SetFrameDataForRenderPasses() method on the FakeDelegatedRendererLayerImpl class. This class constructs a frame data out of a set of render passes, making a bogus set up TransferableResources for each resource in the render passes, and gives the whole frame to the real DelegatedRendererLayerImpl. Tested by all the delegated renderer layer tests. R=piman BUG=123444 Review URL: https://chromiumcodereview.appspot.com/12388082 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185997 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/fake_delegated_renderer_layer_impl.cc')
-rw-r--r--cc/test/fake_delegated_renderer_layer_impl.cc29
1 files changed, 29 insertions, 0 deletions
diff --git a/cc/test/fake_delegated_renderer_layer_impl.cc b/cc/test/fake_delegated_renderer_layer_impl.cc
index 45e8dd2..3f39472 100644
--- a/cc/test/fake_delegated_renderer_layer_impl.cc
+++ b/cc/test/fake_delegated_renderer_layer_impl.cc
@@ -4,7 +4,9 @@
#include "cc/test/fake_delegated_renderer_layer_impl.h"
+#include "base/bind.h"
#include "cc/delegated_frame_data.h"
+#include "cc/draw_quad.h"
namespace cc {
@@ -14,4 +16,31 @@ FakeDelegatedRendererLayerImpl::FakeDelegatedRendererLayerImpl(
FakeDelegatedRendererLayerImpl::~FakeDelegatedRendererLayerImpl() {}
+static ResourceProvider::ResourceId AddResourceToFrame(
+ DelegatedFrameData* frame,
+ ResourceProvider::ResourceId resource_id) {
+ TransferableResource resource;
+ resource.id = resource_id;
+ frame->resource_list.push_back(resource);
+ return resource_id;
+}
+
+void FakeDelegatedRendererLayerImpl::SetFrameDataForRenderPasses(
+ ScopedPtrVector<RenderPass>* pass_list) {
+ scoped_ptr<DelegatedFrameData> delegated_frame(new DelegatedFrameData);
+ delegated_frame->render_pass_list.swap(*pass_list);
+
+ DrawQuad::ResourceIteratorCallback add_resource_to_frame_callback =
+ base::Bind(&AddResourceToFrame,
+ delegated_frame.get());
+ for (size_t i = 0; i < delegated_frame->render_pass_list.size(); ++i) {
+ RenderPass* pass = delegated_frame->render_pass_list[i];
+ for (size_t j = 0; j < pass->quad_list.size(); ++j)
+ pass->quad_list[j]->IterateResources(add_resource_to_frame_callback);
+ }
+
+ TransferableResourceArray resources_for_ack;
+ SetFrameData(delegated_frame.Pass(), gfx::RectF(), &resources_for_ack);
+}
+
} // namespace cc