| 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 bool Map(void** data) override { return false; } | 30 bool Map() override { return false; } |
| 31 void* memory(size_t plane) override { return nullptr; } |
| 31 void Unmap() override {} | 32 void Unmap() override {} |
| 32 gfx::Size GetSize() const override { return gfx::Size(); } | 33 gfx::Size GetSize() const override { return gfx::Size(); } |
| 33 gfx::BufferFormat GetFormat() const override { | 34 gfx::BufferFormat GetFormat() const override { |
| 34 return gfx::BufferFormat::BGRX_8888; | 35 return gfx::BufferFormat::BGRX_8888; |
| 35 } | 36 } |
| 36 void GetStride(int* stride) const override {} | 37 int stride(size_t plane) const override { return 0; } |
| 37 gfx::GpuMemoryBufferId GetId() const override { | 38 gfx::GpuMemoryBufferId GetId() const override { |
| 38 return gfx::GpuMemoryBufferId(0); | 39 return gfx::GpuMemoryBufferId(0); |
| 39 } | 40 } |
| 40 gfx::GpuMemoryBufferHandle GetHandle() const override { | 41 gfx::GpuMemoryBufferHandle GetHandle() const override { |
| 41 return gfx::GpuMemoryBufferHandle(); | 42 return gfx::GpuMemoryBufferHandle(); |
| 42 } | 43 } |
| 43 ClientBuffer AsClientBuffer() override { | 44 ClientBuffer AsClientBuffer() override { |
| 44 return reinterpret_cast<ClientBuffer>(this); | 45 return reinterpret_cast<ClientBuffer>(this); |
| 45 } | 46 } |
| 46 }; | 47 }; |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 // All free buffers should be destroyed, the remaining buffers should all | 551 // All free buffers should be destroyed, the remaining buffers should all |
| 551 // be replaced but still valid. | 552 // be replaced but still valid. |
| 552 EXPECT_EQ(1U, in_flight_surfaces().size()); | 553 EXPECT_EQ(1U, in_flight_surfaces().size()); |
| 553 EXPECT_EQ(0U, available_surfaces().size()); | 554 EXPECT_EQ(0U, available_surfaces().size()); |
| 554 EXPECT_TRUE(displayed_frame().texture); | 555 EXPECT_TRUE(displayed_frame().texture); |
| 555 EXPECT_TRUE(current_frame().texture); | 556 EXPECT_TRUE(current_frame().texture); |
| 556 } | 557 } |
| 557 | 558 |
| 558 } // namespace | 559 } // namespace |
| 559 } // namespace content | 560 } // namespace content |
| OLD | NEW |