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

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: reveman@ comments. 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"
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 Format GetFormat() const override { return gfx::GpuMemoryBuffer::RGBX_8888; } 33 Format GetFormat() const override { return gfx::GpuMemoryBuffer::RGBX_8888; }
34 uint32 GetStride() const override { return 0; } 34 void GetStride(uint32* stride) const override { *stride = 0; }
reveman 2015/03/24 22:16:53 nit: s/{ *stride = 0; }/{}/
emircan 2015/03/24 22:45:16 Done.
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:
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 output_surface_->PageFlipComplete(); 355 output_surface_->PageFlipComplete();
356 EXPECT_EQ(3, CountBuffers()); 356 EXPECT_EQ(3, CountBuffers());
357 CheckUnique(); 357 CheckUnique();
358 EXPECT_NE(0U, current_surface()); 358 EXPECT_NE(0U, current_surface());
359 EXPECT_EQ(1U, in_flight_surfaces().size()); 359 EXPECT_EQ(1U, in_flight_surfaces().size());
360 EXPECT_EQ(1U, available_surfaces().size()); 360 EXPECT_EQ(1U, available_surfaces().size());
361 } 361 }
362 362
363 } // namespace 363 } // namespace
364 } // namespace content 364 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698