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

Side by Side Diff: cc/test/test_gpu_memory_buffer_manager.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 "cc/test/test_gpu_memory_buffer_manager.h" 5 #include "cc/test/test_gpu_memory_buffer_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/gfx/gpu_memory_buffer.h" 8 #include "ui/gfx/gpu_memory_buffer.h"
9 9
10 namespace cc { 10 namespace cc {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 42
43 // Overridden from gfx::GpuMemoryBuffer: 43 // Overridden from gfx::GpuMemoryBuffer:
44 void* Map() override { 44 void* Map() override {
45 DCHECK(!mapped_); 45 DCHECK(!mapped_);
46 if (!shared_memory_->Map(StrideInBytes(size_.width(), format_) * 46 if (!shared_memory_->Map(StrideInBytes(size_.width(), format_) *
47 size_.height())) 47 size_.height()))
48 return NULL; 48 return NULL;
49 mapped_ = true; 49 mapped_ = true;
50 return shared_memory_->memory(); 50 return shared_memory_->memory();
51 } 51 }
52 void* Map(size_t plane_index) override {
53 CHECK_EQ(plane_index, 0u);
54 return Map();
55 }
52 void Unmap() override { 56 void Unmap() override {
53 DCHECK(mapped_); 57 DCHECK(mapped_);
54 shared_memory_->Unmap(); 58 shared_memory_->Unmap();
55 mapped_ = false; 59 mapped_ = false;
56 } 60 }
57 bool IsMapped() const override { return mapped_; } 61 bool IsMapped() const override { return mapped_; }
62 size_t GetNumberOfPlanes() const override { return 1; }
58 Format GetFormat() const override { return format_; } 63 Format GetFormat() const override { return format_; }
59 uint32 GetStride() const override { 64 uint32 GetStride() const override {
60 return StrideInBytes(size_.width(), format_); 65 return StrideInBytes(size_.width(), format_);
61 } 66 }
67 uint32 GetStride(size_t plane_index) const override {
68 CHECK_EQ(plane_index, 0u);
69 return GetStride();
70 }
62 gfx::GpuMemoryBufferHandle GetHandle() const override { 71 gfx::GpuMemoryBufferHandle GetHandle() const override {
63 gfx::GpuMemoryBufferHandle handle; 72 gfx::GpuMemoryBufferHandle handle;
64 handle.type = gfx::SHARED_MEMORY_BUFFER; 73 handle.type = gfx::SHARED_MEMORY_BUFFER;
65 handle.handle = shared_memory_->handle(); 74 handle.handle = shared_memory_->handle();
66 return handle; 75 return handle;
67 } 76 }
68 ClientBuffer AsClientBuffer() override { 77 ClientBuffer AsClientBuffer() override {
69 return reinterpret_cast<ClientBuffer>(this); 78 return reinterpret_cast<ClientBuffer>(this);
70 } 79 }
71 80
(...skipping 30 matching lines...) Expand all
102 ClientBuffer buffer) { 111 ClientBuffer buffer) {
103 return reinterpret_cast<gfx::GpuMemoryBuffer*>(buffer); 112 return reinterpret_cast<gfx::GpuMemoryBuffer*>(buffer);
104 } 113 }
105 114
106 void TestGpuMemoryBufferManager::SetDestructionSyncPoint( 115 void TestGpuMemoryBufferManager::SetDestructionSyncPoint(
107 gfx::GpuMemoryBuffer* buffer, 116 gfx::GpuMemoryBuffer* buffer,
108 uint32 sync_point) { 117 uint32 sync_point) {
109 } 118 }
110 119
111 } // namespace cc 120 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | content/browser/compositor/buffer_queue_unittest.cc » ('j') | content/common/gpu/client/gpu_memory_buffer_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698