OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |