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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 GpuMemoryBufferImpl(base::RefCountedBytes* bytes, | 55 GpuMemoryBufferImpl(base::RefCountedBytes* bytes, |
56 const gfx::Size& size, | 56 const gfx::Size& size, |
57 gfx::GpuMemoryBuffer::Format format) | 57 gfx::GpuMemoryBuffer::Format format) |
58 : bytes_(bytes), size_(size), format_(format), mapped_(false) {} | 58 : bytes_(bytes), size_(size), format_(format), mapped_(false) {} |
59 | 59 |
60 static GpuMemoryBufferImpl* FromClientBuffer(ClientBuffer buffer) { | 60 static GpuMemoryBufferImpl* FromClientBuffer(ClientBuffer buffer) { |
61 return reinterpret_cast<GpuMemoryBufferImpl*>(buffer); | 61 return reinterpret_cast<GpuMemoryBufferImpl*>(buffer); |
62 } | 62 } |
63 | 63 |
64 // Overridden from gfx::GpuMemoryBuffer: | 64 // Overridden from gfx::GpuMemoryBuffer: |
65 virtual void* Map() override { | 65 void* Map() override { |
66 mapped_ = true; | 66 mapped_ = true; |
67 return &bytes_->data().front(); | 67 return &bytes_->data().front(); |
68 } | 68 } |
69 virtual void Unmap() override { mapped_ = false; } | 69 void Unmap() override { mapped_ = false; } |
70 virtual bool IsMapped() const override { return mapped_; } | 70 bool IsMapped() const override { return mapped_; } |
71 virtual Format GetFormat() const override { return format_; } | 71 Format GetFormat() const override { return format_; } |
72 virtual uint32 GetStride() const override { | 72 uint32 GetStride() const override { |
73 return size_.width() * BytesPerPixel(format_); | 73 return size_.width() * BytesPerPixel(format_); |
74 } | 74 } |
75 virtual gfx::GpuMemoryBufferHandle GetHandle() const override { | 75 gfx::GpuMemoryBufferHandle GetHandle() const override { |
76 NOTREACHED(); | 76 NOTREACHED(); |
77 return gfx::GpuMemoryBufferHandle(); | 77 return gfx::GpuMemoryBufferHandle(); |
78 } | 78 } |
79 virtual ClientBuffer AsClientBuffer() override { | 79 ClientBuffer AsClientBuffer() override { |
80 return reinterpret_cast<ClientBuffer>(this); | 80 return reinterpret_cast<ClientBuffer>(this); |
81 } | 81 } |
82 | 82 |
83 base::RefCountedBytes* bytes() { return bytes_.get(); } | 83 base::RefCountedBytes* bytes() { return bytes_.get(); } |
84 | 84 |
85 private: | 85 private: |
86 scoped_refptr<base::RefCountedBytes> bytes_; | 86 scoped_refptr<base::RefCountedBytes> bytes_; |
87 const gfx::Size size_; | 87 const gfx::Size size_; |
88 gfx::GpuMemoryBuffer::Format format_; | 88 gfx::GpuMemoryBuffer::Format format_; |
89 bool mapped_; | 89 bool mapped_; |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 void GLManager::SetSurfaceVisible(bool visible) { | 403 void GLManager::SetSurfaceVisible(bool visible) { |
404 NOTIMPLEMENTED(); | 404 NOTIMPLEMENTED(); |
405 } | 405 } |
406 | 406 |
407 uint32 GLManager::CreateStreamTexture(uint32 texture_id) { | 407 uint32 GLManager::CreateStreamTexture(uint32 texture_id) { |
408 NOTIMPLEMENTED(); | 408 NOTIMPLEMENTED(); |
409 return 0; | 409 return 0; |
410 } | 410 } |
411 | 411 |
412 } // namespace gpu | 412 } // namespace gpu |
OLD | NEW |