OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <set> | 5 #include <set> |
6 | 6 |
7 #include "cc/test/test_context_provider.h" | 7 #include "cc/test/test_context_provider.h" |
8 #include "cc/test/test_web_graphics_context_3d.h" | 8 #include "cc/test/test_web_graphics_context_3d.h" |
9 #include "content/browser/compositor/buffer_queue.h" | 9 #include "content/browser/compositor/buffer_queue.h" |
10 #include "content/browser/compositor/gpu_surfaceless_browser_compositor_output_s
urface.h" | 10 #include "content/browser/compositor/gpu_surfaceless_browser_compositor_output_s
urface.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 const gfx::Rect small_damage = gfx::Rect(gfx::Size(10, 10)); | 155 const gfx::Rect small_damage = gfx::Rect(gfx::Size(10, 10)); |
156 const gfx::Rect large_damage = gfx::Rect(gfx::Size(20, 20)); | 156 const gfx::Rect large_damage = gfx::Rect(gfx::Size(20, 20)); |
157 const gfx::Rect overlapping_damage = gfx::Rect(gfx::Size(5, 20)); | 157 const gfx::Rect overlapping_damage = gfx::Rect(gfx::Size(5, 20)); |
158 | 158 |
159 class MockedContext : public cc::TestWebGraphicsContext3D { | 159 class MockedContext : public cc::TestWebGraphicsContext3D { |
160 public: | 160 public: |
161 MOCK_METHOD2(bindFramebuffer, void(GLenum, GLuint)); | 161 MOCK_METHOD2(bindFramebuffer, void(GLenum, GLuint)); |
162 MOCK_METHOD2(bindTexture, void(GLenum, GLuint)); | 162 MOCK_METHOD2(bindTexture, void(GLenum, GLuint)); |
163 MOCK_METHOD2(bindTexImage2DCHROMIUM, void(GLenum, GLint)); | 163 MOCK_METHOD2(bindTexImage2DCHROMIUM, void(GLenum, GLint)); |
164 MOCK_METHOD4(createImageCHROMIUM, | 164 MOCK_METHOD4(createImageCHROMIUM, |
165 GLuint(ClientBuffer, GLsizei, GLsizei, GLenum)); | 165 GLuint(ClientBuffer*, GLsizei, GLsizei, GLenum)); |
166 MOCK_METHOD1(destroyImageCHROMIUM, void(GLuint)); | 166 MOCK_METHOD1(destroyImageCHROMIUM, void(GLuint)); |
167 MOCK_METHOD5(framebufferTexture2D, | 167 MOCK_METHOD5(framebufferTexture2D, |
168 void(GLenum, GLenum, GLenum, GLuint, GLint)); | 168 void(GLenum, GLenum, GLenum, GLuint, GLint)); |
169 }; | 169 }; |
170 | 170 |
171 scoped_ptr<BufferQueue> CreateOutputSurfaceWithMock( | 171 scoped_ptr<BufferQueue> CreateOutputSurfaceWithMock( |
172 MockedContext** context, | 172 MockedContext** context, |
173 BrowserGpuMemoryBufferManager* gpu_memory_buffer_manager) { | 173 BrowserGpuMemoryBufferManager* gpu_memory_buffer_manager) { |
174 *context = new MockedContext(); | 174 *context = new MockedContext(); |
175 scoped_refptr<cc::TestContextProvider> context_provider = | 175 scoped_refptr<cc::TestContextProvider> context_provider = |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 output_surface_->PageFlipComplete(); | 355 output_surface_->PageFlipComplete(); |
356 EXPECT_EQ(3, CountBuffers()); | 356 EXPECT_EQ(3, CountBuffers()); |
357 CheckUnique(); | 357 CheckUnique(); |
358 EXPECT_NE(0U, current_surface()); | 358 EXPECT_NE(0U, current_surface()); |
359 EXPECT_EQ(1U, in_flight_surfaces().size()); | 359 EXPECT_EQ(1U, in_flight_surfaces().size()); |
360 EXPECT_EQ(1U, available_surfaces().size()); | 360 EXPECT_EQ(1U, available_surfaces().size()); |
361 } | 361 } |
362 | 362 |
363 } // namespace | 363 } // namespace |
364 } // namespace content | 364 } // namespace content |
OLD | NEW |