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

Side by Side Diff: cc/gl_renderer_unittest.cc

Issue 11777025: cc: Implement DelegatingRender::drawFrame() method. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for-landing Created 7 years, 11 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
« no previous file with comments | « cc/gl_renderer.cc ('k') | cc/io_surface_draw_quad.h » ('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/gl_renderer.h" 5 #include "cc/gl_renderer.h"
6 6
7 #include "cc/compositor_frame_metadata.h" 7 #include "cc/compositor_frame_metadata.h"
8 #include "cc/draw_quad.h" 8 #include "cc/draw_quad.h"
9 #include "cc/prioritized_resource_manager.h" 9 #include "cc/prioritized_resource_manager.h"
10 #include "cc/resource_provider.h" 10 #include "cc/resource_provider.h"
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 scoped_ptr<ResourceProvider> resourceProvider(ResourceProvider::create(outpu tSurface.get())); 531 scoped_ptr<ResourceProvider> resourceProvider(ResourceProvider::create(outpu tSurface.get()));
532 FakeRendererGL renderer(&fakeClient, outputSurface.get(), resourceProvider.g et()); 532 FakeRendererGL renderer(&fakeClient, outputSurface.get(), resourceProvider.g et());
533 533
534 // During initialization we are allowed to set any texture parameters. 534 // During initialization we are allowed to set any texture parameters.
535 EXPECT_CALL(*context, texParameteri(_, _, _)).Times(AnyNumber()); 535 EXPECT_CALL(*context, texParameteri(_, _, _)).Times(AnyNumber());
536 EXPECT_TRUE(renderer.initialize()); 536 EXPECT_TRUE(renderer.initialize());
537 537
538 cc::RenderPass::Id id(1, 1); 538 cc::RenderPass::Id id(1, 1);
539 scoped_ptr<TestRenderPass> pass = TestRenderPass::Create(); 539 scoped_ptr<TestRenderPass> pass = TestRenderPass::Create();
540 pass->SetNew(id, gfx::Rect(0, 0, 100, 100), gfx::Rect(0, 0, 100, 100), gfx:: Transform()); 540 pass->SetNew(id, gfx::Rect(0, 0, 100, 100), gfx::Rect(0, 0, 100, 100), gfx:: Transform());
541 pass->AppendOneOfEveryQuadType(resourceProvider.get()); 541 pass->AppendOneOfEveryQuadType(resourceProvider.get(), RenderPass::Id(2, 1)) ;
542 542
543 // Set up expected texture filter state transitions that match the quads 543 // Set up expected texture filter state transitions that match the quads
544 // created in AppendOneOfEveryQuadType(). 544 // created in AppendOneOfEveryQuadType().
545 Mock::VerifyAndClearExpectations(context); 545 Mock::VerifyAndClearExpectations(context);
546 { 546 {
547 InSequence sequence; 547 InSequence sequence;
548 548
549 // yuv_quad is drawn with the default filter. 549 // yuv_quad is drawn with the default linear filter.
550 EXPECT_CALL(*context, drawElements(_, _, _, _)); 550 EXPECT_CALL(*context, drawElements(_, _, _, _));
551 551
552 // tile_quad is drawn with GL_NEAREST because it is not transformed or 552 // tile_quad is drawn with GL_NEAREST because it is not transformed or
553 // scaled. 553 // scaled.
554 EXPECT_CALL(*context, texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER , GL_NEAREST)); 554 EXPECT_CALL(*context, texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER , GL_NEAREST));
555 EXPECT_CALL(*context, texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER , GL_NEAREST)); 555 EXPECT_CALL(*context, texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER , GL_NEAREST));
556 EXPECT_CALL(*context, drawElements(_, _, _, _)); 556 EXPECT_CALL(*context, drawElements(_, _, _, _));
557 557
558 // transformed_tile_quad uses GL_LINEAR. 558 // transformed_tile_quad uses GL_LINEAR.
559 EXPECT_CALL(*context, texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER , GL_LINEAR));
560 EXPECT_CALL(*context, texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER , GL_LINEAR));
561 EXPECT_CALL(*context, drawElements(_, _, _, _)); 559 EXPECT_CALL(*context, drawElements(_, _, _, _));
562 560
563 // scaled_tile_quad also uses GL_LINEAR. 561 // scaled_tile_quad also uses GL_LINEAR.
564 EXPECT_CALL(*context, drawElements(_, _, _, _)); 562 EXPECT_CALL(*context, drawElements(_, _, _, _));
565 563
566 // The remaining quads also use GL_LINEAR because nearest neighbor 564 // The remaining quads also use GL_LINEAR because nearest neighbor
567 // filtering is currently only used with tile quads. 565 // filtering is currently only used with tile quads.
568 EXPECT_CALL(*context, drawElements(_, _, _, _)).Times(6); 566 EXPECT_CALL(*context, drawElements(_, _, _, _)).Times(6);
569 } 567 }
570 568
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 631
634 renderer.decideRenderPassAllocationsForFrame(mockClient.renderPassesInDrawOr der()); 632 renderer.decideRenderPassAllocationsForFrame(mockClient.renderPassesInDrawOr der());
635 renderer.drawFrame(mockClient.renderPassesInDrawOrder()); 633 renderer.drawFrame(mockClient.renderPassesInDrawOrder());
636 634
637 // In multiple render passes all but the root pass should clear the framebuf fer. 635 // In multiple render passes all but the root pass should clear the framebuf fer.
638 Mock::VerifyAndClearExpectations(&mockContext); 636 Mock::VerifyAndClearExpectations(&mockContext);
639 } 637 }
640 638
641 } // namespace 639 } // namespace
642 } // namespace cc 640 } // namespace cc
OLDNEW
« no previous file with comments | « cc/gl_renderer.cc ('k') | cc/io_surface_draw_quad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698