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

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: 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 (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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 void* Map() override {
76 mapped_ = true; 76 mapped_ = true;
77 return &bytes_->data().front(); 77 return &bytes_->data().front();
78 } 78 }
79 void* Map(size_t plane_index) override {
80 CHECK_EQ(plane_index, 0u);
81 return Map();
82 }
79 void Unmap() override { mapped_ = false; } 83 void Unmap() override { mapped_ = false; }
80 bool IsMapped() const override { return mapped_; } 84 bool IsMapped() const override { return mapped_; }
85 size_t GetNumberOfPlanes() const override { return 1; }
81 Format GetFormat() const override { return format_; } 86 Format GetFormat() const override { return format_; }
82 uint32 GetStride() const override { 87 uint32 GetStride() const override {
83 return StrideInBytes(size_.width(), format_); 88 return StrideInBytes(size_.width(), format_);
84 } 89 }
90 uint32 GetStride(size_t plane_index) const override {
91 CHECK_EQ(plane_index, 0u);
92 return GetStride();
93 }
85 gfx::GpuMemoryBufferHandle GetHandle() const override { 94 gfx::GpuMemoryBufferHandle GetHandle() const override {
86 NOTREACHED(); 95 NOTREACHED();
87 return gfx::GpuMemoryBufferHandle(); 96 return gfx::GpuMemoryBufferHandle();
88 } 97 }
89 ClientBuffer AsClientBuffer() override { 98 ClientBuffer AsClientBuffer() override {
90 return reinterpret_cast<ClientBuffer>(this); 99 return reinterpret_cast<ClientBuffer>(this);
91 } 100 }
92 101
93 base::RefCountedBytes* bytes() { return bytes_.get(); } 102 base::RefCountedBytes* bytes() { return bytes_.get(); }
94 103
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 uint32 GLManager::CreateStreamTexture(uint32 texture_id) { 444 uint32 GLManager::CreateStreamTexture(uint32 texture_id) {
436 NOTIMPLEMENTED(); 445 NOTIMPLEMENTED();
437 return 0; 446 return 0;
438 } 447 }
439 448
440 void GLManager::SetLock(base::Lock*) { 449 void GLManager::SetLock(base::Lock*) {
441 NOTIMPLEMENTED(); 450 NOTIMPLEMENTED();
442 } 451 }
443 452
444 } // namespace gpu 453 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698