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

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

Issue 2089753003: cc: Use the correct internal format for glCopyTexImage2D calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: copytextureformat: comments Created 4 years, 6 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/output_surface.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/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 10
(...skipping 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after
1385 RenderPassId root_pass_id(1, 0); 1385 RenderPassId root_pass_id(1, 0);
1386 RenderPass* root_pass = 1386 RenderPass* root_pass =
1387 AddRenderPass(&render_passes_in_draw_order_, root_pass_id, viewport_rect, 1387 AddRenderPass(&render_passes_in_draw_order_, root_pass_id, viewport_rect,
1388 gfx::Transform()); 1388 gfx::Transform());
1389 AddClippedQuad(root_pass, quad_rect, SK_ColorGREEN); 1389 AddClippedQuad(root_pass, quad_rect, SK_ColorGREEN);
1390 1390
1391 unsigned fbo; 1391 unsigned fbo;
1392 gpu::gles2::GLES2Interface* gl = 1392 gpu::gles2::GLES2Interface* gl =
1393 output_surface->context_provider()->ContextGL(); 1393 output_surface->context_provider()->ContextGL();
1394 gl->GenFramebuffers(1, &fbo); 1394 gl->GenFramebuffers(1, &fbo);
1395 output_surface->set_framebuffer(fbo); 1395 output_surface->set_framebuffer(fbo, GL_RGB);
1396 1396
1397 renderer.DecideRenderPassAllocationsForFrame(render_passes_in_draw_order_); 1397 renderer.DecideRenderPassAllocationsForFrame(render_passes_in_draw_order_);
1398 renderer.DrawFrame(&render_passes_in_draw_order_, 1.f, device_viewport_rect, 1398 renderer.DrawFrame(&render_passes_in_draw_order_, 1.f, device_viewport_rect,
1399 device_viewport_rect, false); 1399 device_viewport_rect, false);
1400 1400
1401 int bound_fbo; 1401 int bound_fbo;
1402 gl->GetIntegerv(GL_FRAMEBUFFER_BINDING, &bound_fbo); 1402 gl->GetIntegerv(GL_FRAMEBUFFER_BINDING, &bound_fbo);
1403 EXPECT_EQ(static_cast<int>(fbo), bound_fbo); 1403 EXPECT_EQ(static_cast<int>(fbo), bound_fbo);
1404 } 1404 }
1405 1405
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
1772 nullptr) { 1772 nullptr) {
1773 surface_size_ = gfx::Size(100, 100); 1773 surface_size_ = gfx::Size(100, 100);
1774 } 1774 }
1775 virtual ~MockOutputSurface() {} 1775 virtual ~MockOutputSurface() {}
1776 1776
1777 MOCK_METHOD0(EnsureBackbuffer, void()); 1777 MOCK_METHOD0(EnsureBackbuffer, void());
1778 MOCK_METHOD0(DiscardBackbuffer, void()); 1778 MOCK_METHOD0(DiscardBackbuffer, void());
1779 MOCK_METHOD3(Reshape, 1779 MOCK_METHOD3(Reshape,
1780 void(const gfx::Size& size, float scale_factor, bool has_alpha)); 1780 void(const gfx::Size& size, float scale_factor, bool has_alpha));
1781 MOCK_METHOD0(BindFramebuffer, void()); 1781 MOCK_METHOD0(BindFramebuffer, void());
1782 MOCK_METHOD0(GetFramebufferCopyTextureFormat, GLenum());
1782 MOCK_METHOD1(SwapBuffers, void(CompositorFrame* frame)); 1783 MOCK_METHOD1(SwapBuffers, void(CompositorFrame* frame));
1783 }; 1784 };
1784 1785
1785 class MockOutputSurfaceTest : public GLRendererTest { 1786 class MockOutputSurfaceTest : public GLRendererTest {
1786 protected: 1787 protected:
1787 virtual void SetUp() { 1788 virtual void SetUp() {
1788 FakeOutputSurfaceClient output_surface_client_; 1789 FakeOutputSurfaceClient output_surface_client_;
1789 CHECK(output_surface_.BindToClient(&output_surface_client_)); 1790 CHECK(output_surface_.BindToClient(&output_surface_client_));
1790 1791
1791 shared_bitmap_manager_.reset(new TestSharedBitmapManager()); 1792 shared_bitmap_manager_.reset(new TestSharedBitmapManager());
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
2154 EXPECT_CALL(overlay_scheduler, 2155 EXPECT_CALL(overlay_scheduler,
2155 Schedule(1, gfx::OVERLAY_TRANSFORM_NONE, _, viewport_rect, 2156 Schedule(1, gfx::OVERLAY_TRANSFORM_NONE, _, viewport_rect,
2156 BoundingRect(uv_top_left, uv_bottom_right))).Times(1); 2157 BoundingRect(uv_top_left, uv_bottom_right))).Times(1);
2157 2158
2158 renderer.DrawFrame(&render_passes_in_draw_order_, 1.f, viewport_rect, 2159 renderer.DrawFrame(&render_passes_in_draw_order_, 1.f, viewport_rect,
2159 viewport_rect, false); 2160 viewport_rect, false);
2160 } 2161 }
2161 2162
2162 } // namespace 2163 } // namespace
2163 } // namespace cc 2164 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/gl_renderer.cc ('k') | cc/output/output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698