Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(943)

Side by Side Diff: cc/test/render_pass_test_utils.cc

Issue 191123002: Implement hidpi and pinch-zoom scaling of filter params in cc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/test/render_pass_test_utils.h" 5 #include "cc/test/render_pass_test_utils.h"
6 6
7 #include "cc/layers/append_quads_data.h" 7 #include "cc/layers/append_quads_data.h"
8 #include "cc/layers/quad_sink.h" 8 #include "cc/layers/quad_sink.h"
9 #include "cc/quads/render_pass_draw_quad.h" 9 #include "cc/quads/render_pass_draw_quad.h"
10 #include "cc/quads/shared_quad_state.h" 10 #include "cc/quads/shared_quad_state.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 SharedQuadState* shared_state = 97 SharedQuadState* shared_state =
98 quad_sink.UseSharedQuadState(SharedQuadState::Create()); 98 quad_sink.UseSharedQuadState(SharedQuadState::Create());
99 shared_state->SetAll(gfx::Transform(), 99 shared_state->SetAll(gfx::Transform(),
100 output_rect.size(), 100 output_rect.size(),
101 output_rect, 101 output_rect,
102 output_rect, 102 output_rect,
103 false, 103 false,
104 1, 104 1,
105 SkXfermode::kSrcOver_Mode); 105 SkXfermode::kSrcOver_Mode);
106 scoped_ptr<RenderPassDrawQuad> quad = RenderPassDrawQuad::Create(); 106 scoped_ptr<RenderPassDrawQuad> quad = RenderPassDrawQuad::Create();
107 quad->SetNew(shared_state, output_rect, contributing_pass->id, false, 0, 107 quad->SetNew(shared_state,
108 output_rect, gfx::RectF(), FilterOperations(), 108 output_rect,
109 FilterOperations()); 109 contributing_pass->id,
110 false,
111 0,
112 output_rect,
113 gfx::RectF(),
114 FilterOperations(),
115 FilterOperations(),
116 gfx::Transform());
110 quad_sink.Append(quad.PassAs<DrawQuad>(), &data); 117 quad_sink.Append(quad.PassAs<DrawQuad>(), &data);
111 } 118 }
112 119
113 void AddRenderPassQuad(TestRenderPass* to_pass, 120 void AddRenderPassQuad(TestRenderPass* to_pass,
114 TestRenderPass* contributing_pass, 121 TestRenderPass* contributing_pass,
115 ResourceProvider::ResourceId mask_resource_id, 122 ResourceProvider::ResourceId mask_resource_id,
116 const FilterOperations& filters, 123 const FilterOperations& filters,
117 gfx::Transform transform) { 124 gfx::Transform transform) {
118 MockQuadCuller quad_sink(&to_pass->quad_list, 125 MockQuadCuller quad_sink(&to_pass->quad_list,
119 &to_pass->shared_quad_state_list); 126 &to_pass->shared_quad_state_list);
120 AppendQuadsData data(to_pass->id); 127 AppendQuadsData data(to_pass->id);
121 gfx::Rect output_rect = contributing_pass->output_rect; 128 gfx::Rect output_rect = contributing_pass->output_rect;
122 SharedQuadState* shared_state = 129 SharedQuadState* shared_state =
123 quad_sink.UseSharedQuadState(SharedQuadState::Create()); 130 quad_sink.UseSharedQuadState(SharedQuadState::Create());
124 shared_state->SetAll(transform, 131 shared_state->SetAll(transform,
125 output_rect.size(), 132 output_rect.size(),
126 output_rect, 133 output_rect,
127 output_rect, 134 output_rect,
128 false, 135 false,
129 1, 136 1,
130 SkXfermode::kSrcOver_Mode); 137 SkXfermode::kSrcOver_Mode);
131 scoped_ptr<RenderPassDrawQuad> quad = RenderPassDrawQuad::Create(); 138 scoped_ptr<RenderPassDrawQuad> quad = RenderPassDrawQuad::Create();
132 quad->SetNew(shared_state, output_rect, contributing_pass->id, false, 139 quad->SetNew(shared_state,
133 mask_resource_id, output_rect, gfx::RectF(), filters, 140 output_rect,
134 FilterOperations()); 141 contributing_pass->id,
142 false,
143 mask_resource_id,
144 output_rect,
145 gfx::RectF(),
146 filters,
147 FilterOperations(),
148 gfx::Transform());
135 quad_sink.Append(quad.PassAs<DrawQuad>(), &data); 149 quad_sink.Append(quad.PassAs<DrawQuad>(), &data);
136 } 150 }
137 151
138 } // namespace cc 152 } // namespace cc
OLDNEW
« cc/quads/render_pass_draw_quad.h ('K') | « cc/test/render_pass_test_common.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698