| 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 14 matching lines...) Expand all Loading... |
| 25 unsigned int internalformat) | 25 unsigned int internalformat) |
| 26 : BufferQueue(context_provider, internalformat, nullptr) {} | 26 : BufferQueue(context_provider, internalformat, nullptr) {} |
| 27 MOCK_METHOD4(CopyBufferDamage, | 27 MOCK_METHOD4(CopyBufferDamage, |
| 28 void(int, int, const gfx::Rect&, const gfx::Rect&)); | 28 void(int, int, const gfx::Rect&, const gfx::Rect&)); |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 class BufferQueueTest : public ::testing::Test { | 31 class BufferQueueTest : public ::testing::Test { |
| 32 public: | 32 public: |
| 33 BufferQueueTest() : doublebuffering_(true), first_frame_(true) {} | 33 BufferQueueTest() : doublebuffering_(true), first_frame_(true) {} |
| 34 | 34 |
| 35 virtual void SetUp() override { | 35 void SetUp() override { |
| 36 scoped_refptr<cc::TestContextProvider> context_provider = | 36 scoped_refptr<cc::TestContextProvider> context_provider = |
| 37 cc::TestContextProvider::Create(cc::TestWebGraphicsContext3D::Create()); | 37 cc::TestContextProvider::Create(cc::TestWebGraphicsContext3D::Create()); |
| 38 context_provider->BindToCurrentThread(); | 38 context_provider->BindToCurrentThread(); |
| 39 output_surface_.reset(new MockBufferQueue(context_provider, GL_RGBA)); | 39 output_surface_.reset(new MockBufferQueue(context_provider, GL_RGBA)); |
| 40 output_surface_->Initialize(); | 40 output_surface_->Initialize(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 unsigned current_surface() { return output_surface_->current_surface_.image; } | 43 unsigned current_surface() { return output_surface_->current_surface_.image; } |
| 44 const std::vector<BufferQueue::AllocatedSurface>& available_surfaces() { | 44 const std::vector<BufferQueue::AllocatedSurface>& available_surfaces() { |
| 45 return output_surface_->available_surfaces_; | 45 return output_surface_->available_surfaces_; |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 output_surface_->PageFlipComplete(); | 279 output_surface_->PageFlipComplete(); |
| 280 EXPECT_EQ(3, CountBuffers()); | 280 EXPECT_EQ(3, CountBuffers()); |
| 281 CheckUnique(); | 281 CheckUnique(); |
| 282 EXPECT_NE(0U, current_surface()); | 282 EXPECT_NE(0U, current_surface()); |
| 283 EXPECT_EQ(1U, in_flight_surfaces().size()); | 283 EXPECT_EQ(1U, in_flight_surfaces().size()); |
| 284 EXPECT_EQ(1U, available_surfaces().size()); | 284 EXPECT_EQ(1U, available_surfaces().size()); |
| 285 } | 285 } |
| 286 | 286 |
| 287 } // namespace | 287 } // namespace |
| 288 } // namespace content | 288 } // namespace content |
| OLD | NEW |