Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Side by Side Diff: content/browser/compositor/buffer_queue_unittest.cc

Issue 1024113003: Add multi-planar functions to GpuMemoryBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 10 matching lines...) Expand all
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 void* Map() override { return nullptr; }
31 void* Map(size_t plane_index) override { return nullptr; }
31 void Unmap() override {} 32 void Unmap() override {}
32 bool IsMapped() const override { return false; } 33 bool IsMapped() const override { return false; }
34 size_t GetNumberOfPlanes() const override { return 1; }
33 Format GetFormat() const override { return gfx::GpuMemoryBuffer::RGBX_8888; } 35 Format GetFormat() const override { return gfx::GpuMemoryBuffer::RGBX_8888; }
34 uint32 GetStride() const override { return 0; } 36 uint32 GetStride() const override { return 0; }
37 uint32 GetStride(size_t plane_index) const override { return 0; }
35 gfx::GpuMemoryBufferHandle GetHandle() const override { 38 gfx::GpuMemoryBufferHandle GetHandle() const override {
36 return gfx::GpuMemoryBufferHandle(); 39 return gfx::GpuMemoryBufferHandle();
37 } 40 }
38 ClientBuffer AsClientBuffer() override { 41 ClientBuffer AsClientBuffer() override {
39 return reinterpret_cast<ClientBuffer>(this); 42 return reinterpret_cast<ClientBuffer>(this);
40 } 43 }
41 }; 44 };
42 45
43 class StubBrowserGpuMemoryBufferManager : public BrowserGpuMemoryBufferManager { 46 class StubBrowserGpuMemoryBufferManager : public BrowserGpuMemoryBufferManager {
44 public: 47 public:
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 output_surface_->PageFlipComplete(); 358 output_surface_->PageFlipComplete();
356 EXPECT_EQ(3, CountBuffers()); 359 EXPECT_EQ(3, CountBuffers());
357 CheckUnique(); 360 CheckUnique();
358 EXPECT_NE(0U, current_surface()); 361 EXPECT_NE(0U, current_surface());
359 EXPECT_EQ(1U, in_flight_surfaces().size()); 362 EXPECT_EQ(1U, in_flight_surfaces().size());
360 EXPECT_EQ(1U, available_surfaces().size()); 363 EXPECT_EQ(1U, available_surfaces().size());
361 } 364 }
362 365
363 } // namespace 366 } // namespace
364 } // namespace content 367 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698