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

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

Issue 2687653002: cc: Remove more uniform location caching (Closed)
Patch Set: Review feedback Created 3 years, 10 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_draw_cache.cc ('k') | third_party/WebKit/LayoutTests/TestExpectations » ('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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 renderer_->Initialize(); 403 renderer_->Initialize();
404 renderer_->SetVisible(true); 404 renderer_->SetVisible(true);
405 } 405 }
406 406
407 void TestRenderPassProgram(TexCoordPrecision precision, 407 void TestRenderPassProgram(TexCoordPrecision precision,
408 BlendMode blend_mode) { 408 BlendMode blend_mode) {
409 const Program* program = renderer_->GetProgramIfInitialized( 409 const Program* program = renderer_->GetProgramIfInitialized(
410 ProgramKey::RenderPass(precision, SAMPLER_TYPE_2D, blend_mode, NO_AA, 410 ProgramKey::RenderPass(precision, SAMPLER_TYPE_2D, blend_mode, NO_AA,
411 NO_MASK, false, false)); 411 NO_MASK, false, false));
412 EXPECT_PROGRAM_VALID(program); 412 EXPECT_PROGRAM_VALID(program);
413 EXPECT_EQ(program->program(), renderer_->program_shadow_); 413 EXPECT_EQ(program, renderer_->program_shadow_);
414 } 414 }
415 415
416 void TestRenderPassColorMatrixProgram(TexCoordPrecision precision, 416 void TestRenderPassColorMatrixProgram(TexCoordPrecision precision,
417 BlendMode blend_mode) { 417 BlendMode blend_mode) {
418 const Program* program = renderer_->GetProgramIfInitialized( 418 const Program* program = renderer_->GetProgramIfInitialized(
419 ProgramKey::RenderPass(precision, SAMPLER_TYPE_2D, blend_mode, NO_AA, 419 ProgramKey::RenderPass(precision, SAMPLER_TYPE_2D, blend_mode, NO_AA,
420 NO_MASK, false, true)); 420 NO_MASK, false, true));
421 EXPECT_PROGRAM_VALID(program); 421 EXPECT_PROGRAM_VALID(program);
422 EXPECT_EQ(program->program(), renderer_->program_shadow_); 422 EXPECT_EQ(program, renderer_->program_shadow_);
423 } 423 }
424 424
425 void TestRenderPassMaskProgram(TexCoordPrecision precision, 425 void TestRenderPassMaskProgram(TexCoordPrecision precision,
426 SamplerType sampler, 426 SamplerType sampler,
427 BlendMode blend_mode) { 427 BlendMode blend_mode) {
428 const Program* program = 428 const Program* program =
429 renderer_->GetProgramIfInitialized(ProgramKey::RenderPass( 429 renderer_->GetProgramIfInitialized(ProgramKey::RenderPass(
430 precision, sampler, blend_mode, NO_AA, HAS_MASK, false, false)); 430 precision, sampler, blend_mode, NO_AA, HAS_MASK, false, false));
431 EXPECT_PROGRAM_VALID(program); 431 EXPECT_PROGRAM_VALID(program);
432 EXPECT_EQ(program->program(), renderer_->program_shadow_); 432 EXPECT_EQ(program, renderer_->program_shadow_);
433 } 433 }
434 434
435 void TestRenderPassMaskColorMatrixProgram(TexCoordPrecision precision, 435 void TestRenderPassMaskColorMatrixProgram(TexCoordPrecision precision,
436 SamplerType sampler, 436 SamplerType sampler,
437 BlendMode blend_mode) { 437 BlendMode blend_mode) {
438 const Program* program = 438 const Program* program =
439 renderer_->GetProgramIfInitialized(ProgramKey::RenderPass( 439 renderer_->GetProgramIfInitialized(ProgramKey::RenderPass(
440 precision, sampler, blend_mode, NO_AA, HAS_MASK, false, true)); 440 precision, sampler, blend_mode, NO_AA, HAS_MASK, false, true));
441 EXPECT_PROGRAM_VALID(program); 441 EXPECT_PROGRAM_VALID(program);
442 EXPECT_EQ(program->program(), renderer_->program_shadow_); 442 EXPECT_EQ(program, renderer_->program_shadow_);
443 } 443 }
444 444
445 void TestRenderPassProgramAA(TexCoordPrecision precision, 445 void TestRenderPassProgramAA(TexCoordPrecision precision,
446 BlendMode blend_mode) { 446 BlendMode blend_mode) {
447 const Program* program = renderer_->GetProgramIfInitialized( 447 const Program* program = renderer_->GetProgramIfInitialized(
448 ProgramKey::RenderPass(precision, SAMPLER_TYPE_2D, blend_mode, USE_AA, 448 ProgramKey::RenderPass(precision, SAMPLER_TYPE_2D, blend_mode, USE_AA,
449 NO_MASK, false, false)); 449 NO_MASK, false, false));
450 EXPECT_PROGRAM_VALID(program); 450 EXPECT_PROGRAM_VALID(program);
451 EXPECT_EQ(program->program(), renderer_->program_shadow_); 451 EXPECT_EQ(program, renderer_->program_shadow_);
452 } 452 }
453 453
454 void TestRenderPassColorMatrixProgramAA(TexCoordPrecision precision, 454 void TestRenderPassColorMatrixProgramAA(TexCoordPrecision precision,
455 BlendMode blend_mode) { 455 BlendMode blend_mode) {
456 const Program* program = renderer_->GetProgramIfInitialized( 456 const Program* program = renderer_->GetProgramIfInitialized(
457 ProgramKey::RenderPass(precision, SAMPLER_TYPE_2D, blend_mode, USE_AA, 457 ProgramKey::RenderPass(precision, SAMPLER_TYPE_2D, blend_mode, USE_AA,
458 NO_MASK, false, true)); 458 NO_MASK, false, true));
459 EXPECT_PROGRAM_VALID(program); 459 EXPECT_PROGRAM_VALID(program);
460 EXPECT_EQ(program->program(), renderer_->program_shadow_); 460 EXPECT_EQ(program, renderer_->program_shadow_);
461 } 461 }
462 462
463 void TestRenderPassMaskProgramAA(TexCoordPrecision precision, 463 void TestRenderPassMaskProgramAA(TexCoordPrecision precision,
464 SamplerType sampler, 464 SamplerType sampler,
465 BlendMode blend_mode) { 465 BlendMode blend_mode) {
466 const Program* program = 466 const Program* program =
467 renderer_->GetProgramIfInitialized(ProgramKey::RenderPass( 467 renderer_->GetProgramIfInitialized(ProgramKey::RenderPass(
468 precision, sampler, blend_mode, USE_AA, HAS_MASK, false, false)); 468 precision, sampler, blend_mode, USE_AA, HAS_MASK, false, false));
469 EXPECT_PROGRAM_VALID(program); 469 EXPECT_PROGRAM_VALID(program);
470 EXPECT_EQ(program->program(), renderer_->program_shadow_); 470 EXPECT_EQ(program, renderer_->program_shadow_);
471 } 471 }
472 472
473 void TestRenderPassMaskColorMatrixProgramAA(TexCoordPrecision precision, 473 void TestRenderPassMaskColorMatrixProgramAA(TexCoordPrecision precision,
474 SamplerType sampler, 474 SamplerType sampler,
475 BlendMode blend_mode) { 475 BlendMode blend_mode) {
476 const Program* program = 476 const Program* program =
477 renderer_->GetProgramIfInitialized(ProgramKey::RenderPass( 477 renderer_->GetProgramIfInitialized(ProgramKey::RenderPass(
478 precision, sampler, blend_mode, USE_AA, HAS_MASK, false, true)); 478 precision, sampler, blend_mode, USE_AA, HAS_MASK, false, true));
479 EXPECT_PROGRAM_VALID(program); 479 EXPECT_PROGRAM_VALID(program);
480 EXPECT_EQ(program->program(), renderer_->program_shadow_); 480 EXPECT_EQ(program, renderer_->program_shadow_);
481 } 481 }
482 482
483 void TestSolidColorProgramAA() { 483 void TestSolidColorProgramAA() {
484 const Program* program = 484 const Program* program =
485 renderer_->GetProgramIfInitialized(ProgramKey::SolidColor(USE_AA)); 485 renderer_->GetProgramIfInitialized(ProgramKey::SolidColor(USE_AA));
486 EXPECT_PROGRAM_VALID(program); 486 EXPECT_PROGRAM_VALID(program);
487 EXPECT_EQ(program->program(), renderer_->program_shadow_); 487 EXPECT_EQ(program, renderer_->program_shadow_);
488 } 488 }
489 489
490 RendererSettings settings_; 490 RendererSettings settings_;
491 FakeOutputSurfaceClient output_surface_client_; 491 FakeOutputSurfaceClient output_surface_client_;
492 std::unique_ptr<FakeOutputSurface> output_surface_; 492 std::unique_ptr<FakeOutputSurface> output_surface_;
493 std::unique_ptr<SharedBitmapManager> shared_bitmap_manager_; 493 std::unique_ptr<SharedBitmapManager> shared_bitmap_manager_;
494 std::unique_ptr<ResourceProvider> resource_provider_; 494 std::unique_ptr<ResourceProvider> resource_provider_;
495 std::unique_ptr<FakeRendererGL> renderer_; 495 std::unique_ptr<FakeRendererGL> renderer_;
496 }; 496 };
497 497
(...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after
1984 renderer_->SetVisible(true); 1984 renderer_->SetVisible(true);
1985 Mock::VerifyAndClearExpectations(context_support_ptr_); 1985 Mock::VerifyAndClearExpectations(context_support_ptr_);
1986 1986
1987 EXPECT_CALL(*context_support_ptr_, SetAggressivelyFreeResources(true)); 1987 EXPECT_CALL(*context_support_ptr_, SetAggressivelyFreeResources(true));
1988 renderer_->SetVisible(false); 1988 renderer_->SetVisible(false);
1989 Mock::VerifyAndClearExpectations(context_support_ptr_); 1989 Mock::VerifyAndClearExpectations(context_support_ptr_);
1990 } 1990 }
1991 1991
1992 } // namespace 1992 } // namespace
1993 } // namespace cc 1993 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/gl_renderer_draw_cache.cc ('k') | third_party/WebKit/LayoutTests/TestExpectations » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698