summaryrefslogtreecommitdiffstats
path: root/cc/test/render_pass_test_utils.cc
diff options
context:
space:
mode:
authorweiliangc@chromium.org <weiliangc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-16 14:31:56 +0000
committerweiliangc@chromium.org <weiliangc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-16 14:31:56 +0000
commit3b1739113d632e820b96bba949e138d7a2d33d55 (patch)
treea112dd42e4cf2fb749d08bfe78280bb82a6f3c47 /cc/test/render_pass_test_utils.cc
parentb6dded72b68716b360f84d4273f14de00e36dfb9 (diff)
downloadchromium_src-3b1739113d632e820b96bba949e138d7a2d33d55.zip
chromium_src-3b1739113d632e820b96bba949e138d7a2d33d55.tar.gz
chromium_src-3b1739113d632e820b96bba949e138d7a2d33d55.tar.bz2
Do not use MockQuadCuller when only testing with RenderPass
For unittest that only testing functionatility of Append DrawQuads and SharedQuadState, only creates RenderPass for it. This CL is first part of clean up QuadSink. Next step would be to use test occlusion tracker for MockQuadSink. BUG= TEST=cc_unittests Review URL: https://codereview.chromium.org/288273003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271011 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/render_pass_test_utils.cc')
-rw-r--r--cc/test/render_pass_test_utils.cc26
1 files changed, 10 insertions, 16 deletions
diff --git a/cc/test/render_pass_test_utils.cc b/cc/test/render_pass_test_utils.cc
index e70919a..43cbf1f 100644
--- a/cc/test/render_pass_test_utils.cc
+++ b/cc/test/render_pass_test_utils.cc
@@ -9,7 +9,6 @@
#include "cc/quads/shared_quad_state.h"
#include "cc/quads/solid_color_draw_quad.h"
#include "cc/resources/resource_provider.h"
-#include "cc/test/mock_quad_culler.h"
#include "cc/test/render_pass_test_common.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkImageFilter.h"
@@ -31,8 +30,7 @@ TestRenderPass* AddRenderPass(RenderPassList* pass_list,
SolidColorDrawQuad* AddQuad(TestRenderPass* pass,
const gfx::Rect& rect,
SkColor color) {
- MockQuadCuller quad_sink(pass);
- SharedQuadState* shared_state = quad_sink.CreateSharedQuadState();
+ SharedQuadState* shared_state = pass->CreateAndAppendSharedQuadState();
shared_state->SetAll(gfx::Transform(),
rect.size(),
rect,
@@ -43,15 +41,14 @@ SolidColorDrawQuad* AddQuad(TestRenderPass* pass,
scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create();
quad->SetNew(shared_state, rect, rect, color, false);
SolidColorDrawQuad* quad_ptr = quad.get();
- quad_sink.Append(quad.PassAs<DrawQuad>());
+ pass->AppendDrawQuad(quad.PassAs<DrawQuad>());
return quad_ptr;
}
SolidColorDrawQuad* AddClippedQuad(TestRenderPass* pass,
const gfx::Rect& rect,
SkColor color) {
- MockQuadCuller quad_sink(pass);
- SharedQuadState* shared_state = quad_sink.CreateSharedQuadState();
+ SharedQuadState* shared_state = pass->CreateAndAppendSharedQuadState();
shared_state->SetAll(gfx::Transform(),
rect.size(),
rect,
@@ -62,7 +59,7 @@ SolidColorDrawQuad* AddClippedQuad(TestRenderPass* pass,
scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create();
quad->SetNew(shared_state, rect, rect, color, false);
SolidColorDrawQuad* quad_ptr = quad.get();
- quad_sink.Append(quad.PassAs<DrawQuad>());
+ pass->AppendDrawQuad(quad.PassAs<DrawQuad>());
return quad_ptr;
}
@@ -70,22 +67,20 @@ SolidColorDrawQuad* AddTransformedQuad(TestRenderPass* pass,
const gfx::Rect& rect,
SkColor color,
const gfx::Transform& transform) {
- MockQuadCuller quad_sink(pass);
- SharedQuadState* shared_state = quad_sink.CreateSharedQuadState();
+ SharedQuadState* shared_state = pass->CreateAndAppendSharedQuadState();
shared_state->SetAll(
transform, rect.size(), rect, rect, false, 1, SkXfermode::kSrcOver_Mode);
scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create();
quad->SetNew(shared_state, rect, rect, color, false);
SolidColorDrawQuad* quad_ptr = quad.get();
- quad_sink.Append(quad.PassAs<DrawQuad>());
+ pass->AppendDrawQuad(quad.PassAs<DrawQuad>());
return quad_ptr;
}
void AddRenderPassQuad(TestRenderPass* to_pass,
TestRenderPass* contributing_pass) {
- MockQuadCuller quad_sink(to_pass);
gfx::Rect output_rect = contributing_pass->output_rect;
- SharedQuadState* shared_state = quad_sink.CreateSharedQuadState();
+ SharedQuadState* shared_state = to_pass->CreateAndAppendSharedQuadState();
shared_state->SetAll(gfx::Transform(),
output_rect.size(),
output_rect,
@@ -104,7 +99,7 @@ void AddRenderPassQuad(TestRenderPass* to_pass,
gfx::RectF(),
FilterOperations(),
FilterOperations());
- quad_sink.Append(quad.PassAs<DrawQuad>());
+ to_pass->AppendDrawQuad(quad.PassAs<DrawQuad>());
}
void AddRenderPassQuad(TestRenderPass* to_pass,
@@ -112,9 +107,8 @@ void AddRenderPassQuad(TestRenderPass* to_pass,
ResourceProvider::ResourceId mask_resource_id,
const FilterOperations& filters,
gfx::Transform transform) {
- MockQuadCuller quad_sink(to_pass);
gfx::Rect output_rect = contributing_pass->output_rect;
- SharedQuadState* shared_state = quad_sink.CreateSharedQuadState();
+ SharedQuadState* shared_state = to_pass->CreateAndAppendSharedQuadState();
shared_state->SetAll(transform,
output_rect.size(),
output_rect,
@@ -133,7 +127,7 @@ void AddRenderPassQuad(TestRenderPass* to_pass,
gfx::RectF(),
filters,
FilterOperations());
- quad_sink.Append(quad.PassAs<DrawQuad>());
+ to_pass->AppendDrawQuad(quad.PassAs<DrawQuad>());
}
} // namespace cc