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

Side by Side Diff: gpu/command_buffer/tests/gl_manager.cc

Issue 1024113003: Add multi-planar functions to GpuMemoryBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment fix. 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
« no previous file with comments | « gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc ('k') | ui/gfx/gpu_memory_buffer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "gpu/command_buffer/tests/gl_manager.h" 5 #include "gpu/command_buffer/tests/gl_manager.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <GLES2/gl2ext.h> 8 #include <GLES2/gl2ext.h>
9 #include <GLES2/gl2extchromium.h> 9 #include <GLES2/gl2extchromium.h>
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 GpuMemoryBufferImpl(base::RefCountedBytes* bytes, 65 GpuMemoryBufferImpl(base::RefCountedBytes* bytes,
66 const gfx::Size& size, 66 const gfx::Size& size,
67 gfx::GpuMemoryBuffer::Format format) 67 gfx::GpuMemoryBuffer::Format format)
68 : bytes_(bytes), size_(size), format_(format), mapped_(false) {} 68 : bytes_(bytes), size_(size), format_(format), mapped_(false) {}
69 69
70 static GpuMemoryBufferImpl* FromClientBuffer(ClientBuffer buffer) { 70 static GpuMemoryBufferImpl* FromClientBuffer(ClientBuffer buffer) {
71 return reinterpret_cast<GpuMemoryBufferImpl*>(buffer); 71 return reinterpret_cast<GpuMemoryBufferImpl*>(buffer);
72 } 72 }
73 73
74 // Overridden from gfx::GpuMemoryBuffer: 74 // Overridden from gfx::GpuMemoryBuffer:
75 void* Map() override { 75 bool Map(void** data) override {
76 mapped_ = true; 76 mapped_ = true;
77 return &bytes_->data().front(); 77 *data = &bytes_->data().front();
78 return true;
78 } 79 }
79 void Unmap() override { mapped_ = false; } 80 void Unmap() override { mapped_ = false; }
80 bool IsMapped() const override { return mapped_; } 81 bool IsMapped() const override { return mapped_; }
81 Format GetFormat() const override { return format_; } 82 Format GetFormat() const override { return format_; }
82 uint32 GetStride() const override { 83 void GetStride(uint32* stride) const override {
83 return StrideInBytes(size_.width(), format_); 84 *stride = StrideInBytes(size_.width(), format_);
84 } 85 }
85 gfx::GpuMemoryBufferHandle GetHandle() const override { 86 gfx::GpuMemoryBufferHandle GetHandle() const override {
86 NOTREACHED(); 87 NOTREACHED();
87 return gfx::GpuMemoryBufferHandle(); 88 return gfx::GpuMemoryBufferHandle();
88 } 89 }
89 ClientBuffer AsClientBuffer() override { 90 ClientBuffer AsClientBuffer() override {
90 return reinterpret_cast<ClientBuffer>(this); 91 return reinterpret_cast<ClientBuffer>(this);
91 } 92 }
92 93
93 base::RefCountedBytes* bytes() { return bytes_.get(); } 94 base::RefCountedBytes* bytes() { return bytes_.get(); }
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 uint32 GLManager::CreateStreamTexture(uint32 texture_id) { 436 uint32 GLManager::CreateStreamTexture(uint32 texture_id) {
436 NOTIMPLEMENTED(); 437 NOTIMPLEMENTED();
437 return 0; 438 return 0;
438 } 439 }
439 440
440 void GLManager::SetLock(base::Lock*) { 441 void GLManager::SetLock(base::Lock*) {
441 NOTIMPLEMENTED(); 442 NOTIMPLEMENTED();
442 } 443 }
443 444
444 } // namespace gpu 445 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc ('k') | ui/gfx/gpu_memory_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698