| 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" |
| 11 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" | 11 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
| 12 #include "content/common/gpu/client/gl_helper.h" | 12 #include "content/common/gpu/client/gl_helper.h" |
| 13 #include "gpu/GLES2/gl2extchromium.h" | 13 #include "gpu/GLES2/gl2extchromium.h" |
| 14 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
| 16 #include "third_party/khronos/GLES2/gl2ext.h" | 16 #include "third_party/khronos/GLES2/gl2ext.h" |
| 17 | 17 |
| 18 using ::testing::_; | 18 using ::testing::_; |
| 19 using ::testing::Expectation; | 19 using ::testing::Expectation; |
| 20 using ::testing::Ne; | 20 using ::testing::Ne; |
| 21 using ::testing::Return; | 21 using ::testing::Return; |
| 22 | 22 |
| 23 namespace content { | 23 namespace content { |
| 24 | 24 |
| 25 class StubGpuMemoryBufferImpl : public gfx::GpuMemoryBuffer { | 25 class StubGpuMemoryBufferImpl : public gfx::GpuMemoryBuffer { |
| 26 public: | 26 public: |
| 27 StubGpuMemoryBufferImpl() {} | 27 StubGpuMemoryBufferImpl() {} |
| 28 | 28 |
| 29 // Overridden from gfx::GpuMemoryBuffer: | 29 // Overridden from gfx::GpuMemoryBuffer: |
| 30 void* Map() override { return nullptr; } | 30 bool Map(void** data) override { return false; } |
| 31 void Unmap() override {} | 31 void Unmap() override {} |
| 32 bool IsMapped() const override { return false; } | 32 bool IsMapped() const override { return false; } |
| 33 size_t GetNumberOfPlanes() const override { return 1; } |
| 33 Format GetFormat() const override { return gfx::GpuMemoryBuffer::RGBX_8888; } | 34 Format GetFormat() const override { return gfx::GpuMemoryBuffer::RGBX_8888; } |
| 34 uint32 GetStride() const override { return 0; } | 35 bool GetStride(uint32* stride) const override { |
| 36 stride[0] = 0; |
| 37 return false; |
| 38 } |
| 35 gfx::GpuMemoryBufferHandle GetHandle() const override { | 39 gfx::GpuMemoryBufferHandle GetHandle() const override { |
| 36 return gfx::GpuMemoryBufferHandle(); | 40 return gfx::GpuMemoryBufferHandle(); |
| 37 } | 41 } |
| 38 ClientBuffer AsClientBuffer() override { | 42 ClientBuffer AsClientBuffer() override { |
| 39 return reinterpret_cast<ClientBuffer>(this); | 43 return reinterpret_cast<ClientBuffer>(this); |
| 40 } | 44 } |
| 41 }; | 45 }; |
| 42 | 46 |
| 43 class StubBrowserGpuMemoryBufferManager : public BrowserGpuMemoryBufferManager { | 47 class StubBrowserGpuMemoryBufferManager : public BrowserGpuMemoryBufferManager { |
| 44 public: | 48 public: |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 output_surface_->PageFlipComplete(); | 359 output_surface_->PageFlipComplete(); |
| 356 EXPECT_EQ(3, CountBuffers()); | 360 EXPECT_EQ(3, CountBuffers()); |
| 357 CheckUnique(); | 361 CheckUnique(); |
| 358 EXPECT_NE(0U, current_surface()); | 362 EXPECT_NE(0U, current_surface()); |
| 359 EXPECT_EQ(1U, in_flight_surfaces().size()); | 363 EXPECT_EQ(1U, in_flight_surfaces().size()); |
| 360 EXPECT_EQ(1U, available_surfaces().size()); | 364 EXPECT_EQ(1U, available_surfaces().size()); |
| 361 } | 365 } |
| 362 | 366 |
| 363 } // namespace | 367 } // namespace |
| 364 } // namespace content | 368 } // namespace content |
| OLD | NEW |