| 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 24 matching lines...) Expand all Loading... |
| 35 gfx::GpuMemoryBufferHandle GetHandle() const override { | 35 gfx::GpuMemoryBufferHandle GetHandle() const override { |
| 36 return gfx::GpuMemoryBufferHandle(); | 36 return gfx::GpuMemoryBufferHandle(); |
| 37 } | 37 } |
| 38 ClientBuffer AsClientBuffer() override { | 38 ClientBuffer AsClientBuffer() override { |
| 39 return reinterpret_cast<ClientBuffer>(this); | 39 return reinterpret_cast<ClientBuffer>(this); |
| 40 } | 40 } |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 class StubBrowserGpuMemoryBufferManager : public BrowserGpuMemoryBufferManager { | 43 class StubBrowserGpuMemoryBufferManager : public BrowserGpuMemoryBufferManager { |
| 44 public: | 44 public: |
| 45 StubBrowserGpuMemoryBufferManager() | 45 StubBrowserGpuMemoryBufferManager() {} |
| 46 : BrowserGpuMemoryBufferManager(nullptr, 1) {} | |
| 47 | 46 |
| 48 scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBufferForScanout( | 47 scoped_ptr<gfx::GpuMemoryBuffer> AllocateGpuMemoryBufferForScanout( |
| 49 const gfx::Size& size, | 48 const gfx::Size& size, |
| 50 gfx::GpuMemoryBuffer::Format format, | 49 gfx::GpuMemoryBuffer::Format format, |
| 51 int32 surface_id) override { | 50 int32 surface_id) override { |
| 52 return make_scoped_ptr<gfx::GpuMemoryBuffer>(new StubGpuMemoryBufferImpl); | 51 return make_scoped_ptr<gfx::GpuMemoryBuffer>(new StubGpuMemoryBufferImpl); |
| 53 } | 52 } |
| 54 }; | 53 }; |
| 55 | 54 |
| 56 class MockBufferQueue : public BufferQueue { | 55 class MockBufferQueue : public BufferQueue { |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 for (size_t i = 0; i < kSwapCount; ++i) { | 433 for (size_t i = 0; i < kSwapCount; ++i) { |
| 435 unsigned int next_texture_id = in_flight_surfaces().front().texture; | 434 unsigned int next_texture_id = in_flight_surfaces().front().texture; |
| 436 output_surface_->PageFlipComplete(); | 435 output_surface_->PageFlipComplete(); |
| 437 EXPECT_EQ(displayed_frame().texture, next_texture_id); | 436 EXPECT_EQ(displayed_frame().texture, next_texture_id); |
| 438 EXPECT_NE(0u, displayed_frame().texture); | 437 EXPECT_NE(0u, displayed_frame().texture); |
| 439 } | 438 } |
| 440 } | 439 } |
| 441 | 440 |
| 442 } // namespace | 441 } // namespace |
| 443 } // namespace content | 442 } // namespace content |
| OLD | NEW |