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

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

Issue 2009443002: Revert of Consolidate OutputSurface constructors into GL vs Vulkan. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « blimp/client/feature/compositor/blimp_output_surface.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 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 1132
1133 private: 1133 private:
1134 int discarded_; 1134 int discarded_;
1135 }; 1135 };
1136 1136
1137 class NonReshapableOutputSurface : public FakeOutputSurface { 1137 class NonReshapableOutputSurface : public FakeOutputSurface {
1138 public: 1138 public:
1139 explicit NonReshapableOutputSurface( 1139 explicit NonReshapableOutputSurface(
1140 std::unique_ptr<TestWebGraphicsContext3D> context3d) 1140 std::unique_ptr<TestWebGraphicsContext3D> context3d)
1141 : FakeOutputSurface(TestContextProvider::Create(std::move(context3d)), 1141 : FakeOutputSurface(TestContextProvider::Create(std::move(context3d)),
1142 nullptr,
1143 false) { 1142 false) {
1144 surface_size_ = gfx::Size(500, 500); 1143 surface_size_ = gfx::Size(500, 500);
1145 } 1144 }
1146 void Reshape(const gfx::Size& size, 1145 void Reshape(const gfx::Size& size,
1147 float scale_factor, 1146 float scale_factor,
1148 bool has_alpha) override {} 1147 bool has_alpha) override {}
1149 void set_fixed_size(const gfx::Size& size) { surface_size_ = size; } 1148 void set_fixed_size(const gfx::Size& size) { surface_size_ = size; }
1150 }; 1149 };
1151 1150
1152 TEST_F(GLRendererTest, NoDiscardOnPartialUpdates) { 1151 TEST_F(GLRendererTest, NoDiscardOnPartialUpdates) {
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
1755 MOCK_METHOD2(bindFramebuffer, void(GLenum target, GLuint framebuffer)); 1754 MOCK_METHOD2(bindFramebuffer, void(GLenum target, GLuint framebuffer));
1756 MOCK_METHOD3(reshapeWithScaleFactor, 1755 MOCK_METHOD3(reshapeWithScaleFactor,
1757 void(int width, int height, float scale_factor)); 1756 void(int width, int height, float scale_factor));
1758 MOCK_METHOD4(drawElements, 1757 MOCK_METHOD4(drawElements,
1759 void(GLenum mode, GLsizei count, GLenum type, GLintptr offset)); 1758 void(GLenum mode, GLsizei count, GLenum type, GLintptr offset));
1760 }; 1759 };
1761 1760
1762 class MockOutputSurface : public OutputSurface { 1761 class MockOutputSurface : public OutputSurface {
1763 public: 1762 public:
1764 MockOutputSurface() 1763 MockOutputSurface()
1765 : OutputSurface( 1764 : OutputSurface(TestContextProvider::Create(
1766 TestContextProvider::Create( 1765 std::unique_ptr<TestWebGraphicsContext3D>(
1767 base::MakeUnique<StrictMock<OutputSurfaceMockContext>>()), 1766 new StrictMock<OutputSurfaceMockContext>))) {
1768 nullptr,
1769 nullptr) {
1770 surface_size_ = gfx::Size(100, 100); 1767 surface_size_ = gfx::Size(100, 100);
1771 } 1768 }
1772 virtual ~MockOutputSurface() {} 1769 virtual ~MockOutputSurface() {}
1773 1770
1774 MOCK_METHOD0(EnsureBackbuffer, void()); 1771 MOCK_METHOD0(EnsureBackbuffer, void());
1775 MOCK_METHOD0(DiscardBackbuffer, void()); 1772 MOCK_METHOD0(DiscardBackbuffer, void());
1776 MOCK_METHOD3(Reshape, 1773 MOCK_METHOD3(Reshape,
1777 void(const gfx::Size& size, float scale_factor, bool has_alpha)); 1774 void(const gfx::Size& size, float scale_factor, bool has_alpha));
1778 MOCK_METHOD0(BindFramebuffer, void()); 1775 MOCK_METHOD0(BindFramebuffer, void());
1779 MOCK_METHOD1(SwapBuffers, void(CompositorFrame* frame)); 1776 MOCK_METHOD1(SwapBuffers, void(CompositorFrame* frame));
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
2151 EXPECT_CALL(overlay_scheduler, 2148 EXPECT_CALL(overlay_scheduler,
2152 Schedule(1, gfx::OVERLAY_TRANSFORM_NONE, _, viewport_rect, 2149 Schedule(1, gfx::OVERLAY_TRANSFORM_NONE, _, viewport_rect,
2153 BoundingRect(uv_top_left, uv_bottom_right))).Times(1); 2150 BoundingRect(uv_top_left, uv_bottom_right))).Times(1);
2154 2151
2155 renderer.DrawFrame(&render_passes_in_draw_order_, 1.f, viewport_rect, 2152 renderer.DrawFrame(&render_passes_in_draw_order_, 1.f, viewport_rect,
2156 viewport_rect, false); 2153 viewport_rect, false);
2157 } 2154 }
2158 2155
2159 } // namespace 2156 } // namespace
2160 } // namespace cc 2157 } // namespace cc
OLDNEW
« no previous file with comments | « blimp/client/feature/compositor/blimp_output_surface.cc ('k') | cc/output/output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698