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

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

Issue 2297213003: Fix CSS reference filters with negative transformed children. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « cc/surfaces/surface_aggregator.cc ('k') | cc/test/surface_aggregator_test_helpers.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "cc/quads/debug_border_draw_quad.h" 10 #include "cc/quads/debug_border_draw_quad.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 shared_state->SetAll(gfx::Transform(), 94 shared_state->SetAll(gfx::Transform(),
95 output_rect.size(), 95 output_rect.size(),
96 output_rect, 96 output_rect,
97 output_rect, 97 output_rect,
98 false, 98 false,
99 1, 99 1,
100 SkXfermode::kSrcOver_Mode, 100 SkXfermode::kSrcOver_Mode,
101 0); 101 0);
102 RenderPassDrawQuad* quad = 102 RenderPassDrawQuad* quad =
103 to_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); 103 to_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>();
104 quad->SetNew(shared_state, 104 quad->SetNew(shared_state, output_rect, output_rect, contributing_pass->id, 0,
105 output_rect, 105 gfx::Vector2dF(), gfx::Size(), FilterOperations(),
106 output_rect, 106 gfx::Vector2dF(), gfx::PointF(), FilterOperations());
107 contributing_pass->id,
108 0,
109 gfx::Vector2dF(),
110 gfx::Size(),
111 FilterOperations(),
112 gfx::Vector2dF(),
113 FilterOperations());
114 } 107 }
115 108
116 void AddRenderPassQuad(RenderPass* to_pass, 109 void AddRenderPassQuad(RenderPass* to_pass,
117 RenderPass* contributing_pass, 110 RenderPass* contributing_pass,
118 ResourceId mask_resource_id, 111 ResourceId mask_resource_id,
119 const FilterOperations& filters, 112 const FilterOperations& filters,
120 gfx::Transform transform, 113 gfx::Transform transform,
121 SkXfermode::Mode blend_mode) { 114 SkXfermode::Mode blend_mode) {
122 gfx::Rect output_rect = contributing_pass->output_rect; 115 gfx::Rect output_rect = contributing_pass->output_rect;
123 SharedQuadState* shared_state = to_pass->CreateAndAppendSharedQuadState(); 116 SharedQuadState* shared_state = to_pass->CreateAndAppendSharedQuadState();
124 shared_state->SetAll(transform, 117 shared_state->SetAll(transform,
125 output_rect.size(), 118 output_rect.size(),
126 output_rect, 119 output_rect,
127 output_rect, 120 output_rect,
128 false, 121 false,
129 1, 122 1,
130 blend_mode, 123 blend_mode,
131 0); 124 0);
132 RenderPassDrawQuad* quad = 125 RenderPassDrawQuad* quad =
133 to_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); 126 to_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>();
134 gfx::Size arbitrary_nonzero_size(1, 1); 127 gfx::Size arbitrary_nonzero_size(1, 1);
135 quad->SetNew(shared_state, 128 quad->SetNew(shared_state, output_rect, output_rect, contributing_pass->id,
136 output_rect, 129 mask_resource_id, gfx::Vector2dF(1.f, 1.f),
137 output_rect, 130 arbitrary_nonzero_size, filters, gfx::Vector2dF(), gfx::PointF(),
138 contributing_pass->id,
139 mask_resource_id,
140 gfx::Vector2dF(1.f, 1.f),
141 arbitrary_nonzero_size,
142 filters,
143 gfx::Vector2dF(),
144 FilterOperations()); 131 FilterOperations());
145 } 132 }
146 133
147 static void EmptyReleaseCallback(const gpu::SyncToken& sync_token, 134 static void EmptyReleaseCallback(const gpu::SyncToken& sync_token,
148 bool lost_resource, 135 bool lost_resource,
149 BlockingTaskRunner* main_thread_task_runner) {} 136 BlockingTaskRunner* main_thread_task_runner) {}
150 137
151 void AddOneOfEveryQuadType(RenderPass* to_pass, 138 void AddOneOfEveryQuadType(RenderPass* to_pass,
152 ResourceProvider* resource_provider, 139 ResourceProvider* resource_provider,
153 RenderPassId child_pass, 140 RenderPassId child_pass,
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 shared_state->SetAll(gfx::Transform(), rect.size(), rect, rect, false, 1, 193 shared_state->SetAll(gfx::Transform(), rect.size(), rect, rect, false, 1,
207 SkXfermode::kSrcOver_Mode, 0); 194 SkXfermode::kSrcOver_Mode, 0);
208 195
209 DebugBorderDrawQuad* debug_border_quad = 196 DebugBorderDrawQuad* debug_border_quad =
210 to_pass->CreateAndAppendDrawQuad<DebugBorderDrawQuad>(); 197 to_pass->CreateAndAppendDrawQuad<DebugBorderDrawQuad>();
211 debug_border_quad->SetNew(shared_state, rect, visible_rect, SK_ColorRED, 1); 198 debug_border_quad->SetNew(shared_state, rect, visible_rect, SK_ColorRED, 1);
212 199
213 if (child_pass.layer_id) { 200 if (child_pass.layer_id) {
214 RenderPassDrawQuad* render_pass_quad = 201 RenderPassDrawQuad* render_pass_quad =
215 to_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); 202 to_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>();
216 render_pass_quad->SetNew(shared_state, rect, visible_rect, child_pass, 203 render_pass_quad->SetNew(
217 resource5, gfx::Vector2dF(1.f, 1.f), 204 shared_state, rect, visible_rect, child_pass, resource5,
218 resource5_size, FilterOperations(), 205 gfx::Vector2dF(1.f, 1.f), resource5_size, FilterOperations(),
219 gfx::Vector2dF(), FilterOperations()); 206 gfx::Vector2dF(), gfx::PointF(), FilterOperations());
220 207
221 RenderPassDrawQuad* render_pass_replica_quad = 208 RenderPassDrawQuad* render_pass_replica_quad =
222 to_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); 209 to_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>();
223 render_pass_replica_quad->SetNew( 210 render_pass_replica_quad->SetNew(
224 shared_state, rect, visible_rect, child_pass, resource5, 211 shared_state, rect, visible_rect, child_pass, resource5,
225 gfx::Vector2dF(1.f, 1.f), resource5_size, FilterOperations(), 212 gfx::Vector2dF(1.f, 1.f), resource5_size, FilterOperations(),
226 gfx::Vector2dF(), FilterOperations()); 213 gfx::Vector2dF(), gfx::PointF(), FilterOperations());
227 } 214 }
228 215
229 SolidColorDrawQuad* solid_color_quad = 216 SolidColorDrawQuad* solid_color_quad =
230 to_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); 217 to_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
231 solid_color_quad->SetNew(shared_state, rect, visible_rect, SK_ColorRED, 218 solid_color_quad->SetNew(shared_state, rect, visible_rect, SK_ColorRED,
232 false); 219 false);
233 220
234 StreamVideoDrawQuad* stream_video_quad = 221 StreamVideoDrawQuad* stream_video_quad =
235 to_pass->CreateAndAppendDrawQuad<StreamVideoDrawQuad>(); 222 to_pass->CreateAndAppendDrawQuad<StreamVideoDrawQuad>();
236 stream_video_quad->SetNew(shared_state, rect, opaque_rect, visible_rect, 223 stream_video_quad->SetNew(shared_state, rect, opaque_rect, visible_rect,
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 to_pass->CreateAndAppendDrawQuad<YUVVideoDrawQuad>(); 278 to_pass->CreateAndAppendDrawQuad<YUVVideoDrawQuad>();
292 yuv_quad->SetNew(shared_state2, rect, opaque_rect, visible_rect, 279 yuv_quad->SetNew(shared_state2, rect, opaque_rect, visible_rect,
293 gfx::RectF(.0f, .0f, 100.0f, 100.0f), 280 gfx::RectF(.0f, .0f, 100.0f, 100.0f),
294 gfx::RectF(.0f, .0f, 50.0f, 50.0f), gfx::Size(100, 100), 281 gfx::RectF(.0f, .0f, 50.0f, 50.0f), gfx::Size(100, 100),
295 gfx::Size(50, 50), plane_resources[0], plane_resources[1], 282 gfx::Size(50, 50), plane_resources[0], plane_resources[1],
296 plane_resources[2], plane_resources[3], color_space, 283 plane_resources[2], plane_resources[3], color_space,
297 gfx::ColorSpace::CreateJpeg(), 0.0, 1.0, 8); 284 gfx::ColorSpace::CreateJpeg(), 0.0, 1.0, 8);
298 } 285 }
299 286
300 } // namespace cc 287 } // namespace cc
OLDNEW
« no previous file with comments | « cc/surfaces/surface_aggregator.cc ('k') | cc/test/surface_aggregator_test_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698