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-07 15:39:41 +0000
committerweiliangc@chromium.org <weiliangc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-07 15:39:41 +0000
commit9be1adc83cd60051957268b4aa6517cf2c23fbbb (patch)
tree7930ff16a9ead5412d0a5a10dd325e4b575a6c87 /cc/test/render_pass_test_utils.cc
parentaf5e7996e4e5e60ea67512143a226aac952a695d (diff)
downloadchromium_src-9be1adc83cd60051957268b4aa6517cf2c23fbbb.zip
chromium_src-9be1adc83cd60051957268b4aa6517cf2c23fbbb.tar.gz
chromium_src-9be1adc83cd60051957268b4aa6517cf2c23fbbb.tar.bz2
Create SharedQuadState on RenderPass
Instead of creating SharedQuadState on layers and pass ownership around, create SharedQuadState on RenderPass and only pass the raw pointer to layers. Also let QuadCuller hold pointer to RenderPass instead of two points to DrawQuadList and SharedQuadStateList that is owned by RenderPass. BUG=344962 TEST=cc_unittests Review URL: https://codereview.chromium.org/265823015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268785 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/render_pass_test_utils.cc')
-rw-r--r--cc/test/render_pass_test_utils.cc27
1 files changed, 10 insertions, 17 deletions
diff --git a/cc/test/render_pass_test_utils.cc b/cc/test/render_pass_test_utils.cc
index 8d0d955..e70919a 100644
--- a/cc/test/render_pass_test_utils.cc
+++ b/cc/test/render_pass_test_utils.cc
@@ -31,9 +31,8 @@ TestRenderPass* AddRenderPass(RenderPassList* pass_list,
SolidColorDrawQuad* AddQuad(TestRenderPass* pass,
const gfx::Rect& rect,
SkColor color) {
- MockQuadCuller quad_sink(&pass->quad_list, &pass->shared_quad_state_list);
- SharedQuadState* shared_state =
- quad_sink.UseSharedQuadState(SharedQuadState::Create());
+ MockQuadCuller quad_sink(pass);
+ SharedQuadState* shared_state = quad_sink.CreateSharedQuadState();
shared_state->SetAll(gfx::Transform(),
rect.size(),
rect,
@@ -51,9 +50,8 @@ SolidColorDrawQuad* AddQuad(TestRenderPass* pass,
SolidColorDrawQuad* AddClippedQuad(TestRenderPass* pass,
const gfx::Rect& rect,
SkColor color) {
- MockQuadCuller quad_sink(&pass->quad_list, &pass->shared_quad_state_list);
- SharedQuadState* shared_state =
- quad_sink.UseSharedQuadState(SharedQuadState::Create());
+ MockQuadCuller quad_sink(pass);
+ SharedQuadState* shared_state = quad_sink.CreateSharedQuadState();
shared_state->SetAll(gfx::Transform(),
rect.size(),
rect,
@@ -72,9 +70,8 @@ SolidColorDrawQuad* AddTransformedQuad(TestRenderPass* pass,
const gfx::Rect& rect,
SkColor color,
const gfx::Transform& transform) {
- MockQuadCuller quad_sink(&pass->quad_list, &pass->shared_quad_state_list);
- SharedQuadState* shared_state =
- quad_sink.UseSharedQuadState(SharedQuadState::Create());
+ MockQuadCuller quad_sink(pass);
+ SharedQuadState* shared_state = quad_sink.CreateSharedQuadState();
shared_state->SetAll(
transform, rect.size(), rect, rect, false, 1, SkXfermode::kSrcOver_Mode);
scoped_ptr<SolidColorDrawQuad> quad = SolidColorDrawQuad::Create();
@@ -86,11 +83,9 @@ SolidColorDrawQuad* AddTransformedQuad(TestRenderPass* pass,
void AddRenderPassQuad(TestRenderPass* to_pass,
TestRenderPass* contributing_pass) {
- MockQuadCuller quad_sink(&to_pass->quad_list,
- &to_pass->shared_quad_state_list);
+ MockQuadCuller quad_sink(to_pass);
gfx::Rect output_rect = contributing_pass->output_rect;
- SharedQuadState* shared_state =
- quad_sink.UseSharedQuadState(SharedQuadState::Create());
+ SharedQuadState* shared_state = quad_sink.CreateSharedQuadState();
shared_state->SetAll(gfx::Transform(),
output_rect.size(),
output_rect,
@@ -117,11 +112,9 @@ void AddRenderPassQuad(TestRenderPass* to_pass,
ResourceProvider::ResourceId mask_resource_id,
const FilterOperations& filters,
gfx::Transform transform) {
- MockQuadCuller quad_sink(&to_pass->quad_list,
- &to_pass->shared_quad_state_list);
+ MockQuadCuller quad_sink(to_pass);
gfx::Rect output_rect = contributing_pass->output_rect;
- SharedQuadState* shared_state =
- quad_sink.UseSharedQuadState(SharedQuadState::Create());
+ SharedQuadState* shared_state = quad_sink.CreateSharedQuadState();
shared_state->SetAll(transform,
output_rect.size(),
output_rect,