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

Side by Side Diff: cc/output/gl_renderer_unittest.cc

Issue 988693005: Chromium roll (https://codereview.chromium.org/976353002) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: fixed bad android build patch Created 5 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
« no previous file with comments | « cc/output/gl_renderer.cc ('k') | cc/output/overlay_unittest.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/output/gl_renderer.h" 5 #include "cc/output/gl_renderer.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "cc/base/math_util.h" 9 #include "cc/base/math_util.h"
10 #include "cc/output/compositor_frame_metadata.h" 10 #include "cc/output/compositor_frame_metadata.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 EXPECT_PROGRAM_VALID(renderer()->GetTileProgram(precision, sampler)); 142 EXPECT_PROGRAM_VALID(renderer()->GetTileProgram(precision, sampler));
143 EXPECT_PROGRAM_VALID(renderer()->GetTileProgramOpaque(precision, sampler)); 143 EXPECT_PROGRAM_VALID(renderer()->GetTileProgramOpaque(precision, sampler));
144 EXPECT_PROGRAM_VALID(renderer()->GetTileProgramAA(precision, sampler)); 144 EXPECT_PROGRAM_VALID(renderer()->GetTileProgramAA(precision, sampler));
145 EXPECT_PROGRAM_VALID(renderer()->GetTileProgramSwizzle(precision, sampler)); 145 EXPECT_PROGRAM_VALID(renderer()->GetTileProgramSwizzle(precision, sampler));
146 EXPECT_PROGRAM_VALID( 146 EXPECT_PROGRAM_VALID(
147 renderer()->GetTileProgramSwizzleOpaque(precision, sampler)); 147 renderer()->GetTileProgramSwizzleOpaque(precision, sampler));
148 EXPECT_PROGRAM_VALID( 148 EXPECT_PROGRAM_VALID(
149 renderer()->GetTileProgramSwizzleAA(precision, sampler)); 149 renderer()->GetTileProgramSwizzleAA(precision, sampler));
150 for (int i = 0; i <= LAST_BLEND_MODE; ++i) { 150 for (int i = 0; i <= LAST_BLEND_MODE; ++i) {
151 BlendMode blend_mode = static_cast<BlendMode>(i); 151 BlendMode blend_mode = static_cast<BlendMode>(i);
152 EXPECT_PROGRAM_VALID( 152 for (int l = 0; l <= 1; ++l) {
153 renderer()->GetRenderPassMaskProgram(precision, sampler, blend_mode)); 153 bool mask_for_background = (l == 1);
154 EXPECT_PROGRAM_VALID(renderer()->GetRenderPassMaskProgramAA( 154 EXPECT_PROGRAM_VALID(
155 precision, sampler, blend_mode)); 155 renderer()->GetRenderPassMaskProgram(precision,
156 EXPECT_PROGRAM_VALID(renderer()->GetRenderPassMaskColorMatrixProgramAA( 156 sampler,
157 precision, sampler, blend_mode)); 157 blend_mode,
158 EXPECT_PROGRAM_VALID(renderer()->GetRenderPassMaskColorMatrixProgram( 158 mask_for_background));
159 precision, sampler, blend_mode)); 159 EXPECT_PROGRAM_VALID(renderer()->GetRenderPassMaskProgramAA(
160 precision, sampler, blend_mode, mask_for_background));
161 EXPECT_PROGRAM_VALID(renderer()->GetRenderPassMaskColorMatrixProgramAA(
162 precision, sampler, blend_mode, mask_for_background));
163 EXPECT_PROGRAM_VALID(renderer()->GetRenderPassMaskColorMatrixProgram(
164 precision, sampler, blend_mode, mask_for_background));
165 }
160 } 166 }
161 } 167 }
162 }; 168 };
163 169
164 namespace { 170 namespace {
165 171
166 #if !defined(OS_ANDROID) 172 #if !defined(OS_ANDROID)
167 TEST_F(GLRendererShaderPixelTest, AllShadersCompile) { TestShaders(); } 173 TEST_F(GLRendererShaderPixelTest, AllShadersCompile) { TestShaders(); }
168 #endif 174 #endif
169 175
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 EXPECT_EQ( 268 EXPECT_EQ(
263 renderer_->render_pass_color_matrix_program_[precision][blend_mode] 269 renderer_->render_pass_color_matrix_program_[precision][blend_mode]
264 .program(), 270 .program(),
265 renderer_->program_shadow_); 271 renderer_->program_shadow_);
266 } 272 }
267 273
268 void TestRenderPassMaskProgram(TexCoordPrecision precision, 274 void TestRenderPassMaskProgram(TexCoordPrecision precision,
269 SamplerType sampler, 275 SamplerType sampler,
270 BlendMode blend_mode) { 276 BlendMode blend_mode) {
271 EXPECT_PROGRAM_VALID( 277 EXPECT_PROGRAM_VALID(
272 &renderer_->render_pass_mask_program_[precision][sampler][blend_mode]); 278 &renderer_->render_pass_mask_program_[precision]
279 [sampler]
280 [blend_mode]
281 [NO_MASK]);
273 EXPECT_EQ( 282 EXPECT_EQ(
274 renderer_->render_pass_mask_program_[precision][sampler][blend_mode] 283 renderer_->render_pass_mask_program_[precision]
275 .program(), 284 [sampler]
285 [blend_mode]
286 [NO_MASK].program(),
276 renderer_->program_shadow_); 287 renderer_->program_shadow_);
277 } 288 }
278 289
279 void TestRenderPassMaskColorMatrixProgram(TexCoordPrecision precision, 290 void TestRenderPassMaskColorMatrixProgram(TexCoordPrecision precision,
280 SamplerType sampler, 291 SamplerType sampler,
281 BlendMode blend_mode) { 292 BlendMode blend_mode) {
282 EXPECT_PROGRAM_VALID(&renderer_->render_pass_mask_color_matrix_program_ 293 EXPECT_PROGRAM_VALID(&renderer_->render_pass_mask_color_matrix_program_
283 [precision][sampler][blend_mode]); 294 [precision][sampler][blend_mode][NO_MASK]);
284 EXPECT_EQ(renderer_->render_pass_mask_color_matrix_program_ 295 EXPECT_EQ(renderer_->render_pass_mask_color_matrix_program_
285 [precision][sampler][blend_mode].program(), 296 [precision][sampler][blend_mode][NO_MASK].program(),
286 renderer_->program_shadow_); 297 renderer_->program_shadow_);
287 } 298 }
288 299
289 void TestRenderPassProgramAA(TexCoordPrecision precision, 300 void TestRenderPassProgramAA(TexCoordPrecision precision,
290 BlendMode blend_mode) { 301 BlendMode blend_mode) {
291 EXPECT_PROGRAM_VALID( 302 EXPECT_PROGRAM_VALID(
292 &renderer_->render_pass_program_aa_[precision][blend_mode]); 303 &renderer_->render_pass_program_aa_[precision][blend_mode]);
293 EXPECT_EQ( 304 EXPECT_EQ(
294 renderer_->render_pass_program_aa_[precision][blend_mode].program(), 305 renderer_->render_pass_program_aa_[precision][blend_mode].program(),
295 renderer_->program_shadow_); 306 renderer_->program_shadow_);
296 } 307 }
297 308
298 void TestRenderPassColorMatrixProgramAA(TexCoordPrecision precision, 309 void TestRenderPassColorMatrixProgramAA(TexCoordPrecision precision,
299 BlendMode blend_mode) { 310 BlendMode blend_mode) {
300 EXPECT_PROGRAM_VALID( 311 EXPECT_PROGRAM_VALID(
301 &renderer_ 312 &renderer_
302 ->render_pass_color_matrix_program_aa_[precision][blend_mode]); 313 ->render_pass_color_matrix_program_aa_[precision][blend_mode]);
303 EXPECT_EQ( 314 EXPECT_EQ(
304 renderer_->render_pass_color_matrix_program_aa_[precision][blend_mode] 315 renderer_->render_pass_color_matrix_program_aa_[precision][blend_mode]
305 .program(), 316 .program(),
306 renderer_->program_shadow_); 317 renderer_->program_shadow_);
307 } 318 }
308 319
309 void TestRenderPassMaskProgramAA(TexCoordPrecision precision, 320 void TestRenderPassMaskProgramAA(TexCoordPrecision precision,
310 SamplerType sampler, 321 SamplerType sampler,
311 BlendMode blend_mode) { 322 BlendMode blend_mode) {
312 EXPECT_PROGRAM_VALID( 323 EXPECT_PROGRAM_VALID(
313 &renderer_ 324 &renderer_
314 ->render_pass_mask_program_aa_[precision][sampler][blend_mode]); 325 ->render_pass_mask_program_aa_
326 [precision][sampler][blend_mode][NO_MASK]);
315 EXPECT_EQ( 327 EXPECT_EQ(
316 renderer_->render_pass_mask_program_aa_[precision][sampler][blend_mode] 328 renderer_->render_pass_mask_program_aa_[precision][sampler][blend_mode]
317 .program(), 329 [NO_MASK].program(),
318 renderer_->program_shadow_); 330 renderer_->program_shadow_);
319 } 331 }
320 332
321 void TestRenderPassMaskColorMatrixProgramAA(TexCoordPrecision precision, 333 void TestRenderPassMaskColorMatrixProgramAA(TexCoordPrecision precision,
322 SamplerType sampler, 334 SamplerType sampler,
323 BlendMode blend_mode) { 335 BlendMode blend_mode) {
324 EXPECT_PROGRAM_VALID(&renderer_->render_pass_mask_color_matrix_program_aa_ 336 EXPECT_PROGRAM_VALID(&renderer_->render_pass_mask_color_matrix_program_aa_
325 [precision][sampler][blend_mode]); 337 [precision][sampler][blend_mode][NO_MASK]);
326 EXPECT_EQ(renderer_->render_pass_mask_color_matrix_program_aa_ 338 EXPECT_EQ(renderer_->render_pass_mask_color_matrix_program_aa_
327 [precision][sampler][blend_mode].program(), 339 [precision][sampler][blend_mode][NO_MASK].program(),
328 renderer_->program_shadow_); 340 renderer_->program_shadow_);
329 } 341 }
330 342
331 void TestSolidColorProgramAA() { 343 void TestSolidColorProgramAA() {
332 EXPECT_PROGRAM_VALID(&renderer_->solid_color_program_aa_); 344 EXPECT_PROGRAM_VALID(&renderer_->solid_color_program_aa_);
333 EXPECT_EQ(renderer_->solid_color_program_aa_.program(), 345 EXPECT_EQ(renderer_->solid_color_program_aa_.program(),
334 renderer_->program_shadow_); 346 renderer_->program_shadow_);
335 } 347 }
336 348
337 RendererSettings settings_; 349 RendererSettings settings_;
(...skipping 1632 matching lines...) Expand 10 before | Expand all | Expand 10 after
1970 base::MessageLoop::current()->Run(); 1982 base::MessageLoop::current()->Run();
1971 1983
1972 // The sync point should have happened. 1984 // The sync point should have happened.
1973 EXPECT_EQ(1, sync_point_callback_count); 1985 EXPECT_EQ(1, sync_point_callback_count);
1974 EXPECT_EQ(1, other_callback_count); 1986 EXPECT_EQ(1, other_callback_count);
1975 } 1987 }
1976 #endif // OS_ANDROID 1988 #endif // OS_ANDROID
1977 1989
1978 } // namespace 1990 } // namespace
1979 } // namespace cc 1991 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/gl_renderer.cc ('k') | cc/output/overlay_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698