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 #include <stddef.h> | 10 #include <stddef.h> |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_)); | 77 DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_)); |
78 return reinterpret_cast<uint8_t*>(&bytes_->data().front()) + | 78 return reinterpret_cast<uint8_t*>(&bytes_->data().front()) + |
79 gfx::BufferOffsetForBufferFormat(size_, format_, plane); | 79 gfx::BufferOffsetForBufferFormat(size_, format_, plane); |
80 } | 80 } |
81 void Unmap() override { | 81 void Unmap() override { |
82 DCHECK(mapped_); | 82 DCHECK(mapped_); |
83 mapped_ = false; | 83 mapped_ = false; |
84 } | 84 } |
85 gfx::Size GetSize() const override { return size_; } | 85 gfx::Size GetSize() const override { return size_; } |
86 gfx::BufferFormat GetFormat() const override { return format_; } | 86 gfx::BufferFormat GetFormat() const override { return format_; } |
87 int stride(size_t plane) const override { | 87 uint32_t stride(size_t plane) const override { |
88 DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_)); | 88 DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_)); |
89 return gfx::RowSizeForBufferFormat(size_.width(), format_, plane); | 89 return gfx::RowSizeForBufferFormat(size_.width(), format_, plane); |
90 } | 90 } |
91 gfx::GpuMemoryBufferId GetId() const override { | 91 gfx::GpuMemoryBufferId GetId() const override { |
92 NOTREACHED(); | 92 NOTREACHED(); |
93 return gfx::GpuMemoryBufferId(0); | 93 return gfx::GpuMemoryBufferId(0); |
94 } | 94 } |
95 gfx::GpuMemoryBufferHandle GetHandle() const override { | 95 gfx::GpuMemoryBufferHandle GetHandle() const override { |
96 NOTREACHED(); | 96 NOTREACHED(); |
97 return gfx::GpuMemoryBufferHandle(); | 97 return gfx::GpuMemoryBufferHandle(); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 DCHECK(mapped_); | 135 DCHECK(mapped_); |
136 DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_)); | 136 DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_)); |
137 return IOSurfaceGetBaseAddressOfPlane(iosurface_, plane); | 137 return IOSurfaceGetBaseAddressOfPlane(iosurface_, plane); |
138 } | 138 } |
139 void Unmap() override { | 139 void Unmap() override { |
140 DCHECK(mapped_); | 140 DCHECK(mapped_); |
141 mapped_ = false; | 141 mapped_ = false; |
142 } | 142 } |
143 gfx::Size GetSize() const override { return size_; } | 143 gfx::Size GetSize() const override { return size_; } |
144 gfx::BufferFormat GetFormat() const override { return format_; } | 144 gfx::BufferFormat GetFormat() const override { return format_; } |
145 int stride(size_t plane) const override { | 145 uint32_t stride(size_t plane) const override { |
146 DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_)); | 146 DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_)); |
147 return IOSurfaceGetWidthOfPlane(iosurface_, plane); | 147 return IOSurfaceGetWidthOfPlane(iosurface_, plane); |
148 } | 148 } |
149 gfx::GpuMemoryBufferId GetId() const override { | 149 gfx::GpuMemoryBufferId GetId() const override { |
150 NOTREACHED(); | 150 NOTREACHED(); |
151 return gfx::GpuMemoryBufferId(0); | 151 return gfx::GpuMemoryBufferId(0); |
152 } | 152 } |
153 gfx::GpuMemoryBufferHandle GetHandle() const override { | 153 gfx::GpuMemoryBufferHandle GetHandle() const override { |
154 NOTREACHED(); | 154 NOTREACHED(); |
155 return gfx::GpuMemoryBufferHandle(); | 155 return gfx::GpuMemoryBufferHandle(); |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 | 630 |
631 // Something went wrong, just run the callback now. | 631 // Something went wrong, just run the callback now. |
632 callback.Run(); | 632 callback.Run(); |
633 } | 633 } |
634 | 634 |
635 bool GLManager::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { | 635 bool GLManager::CanWaitUnverifiedSyncToken(const gpu::SyncToken* sync_token) { |
636 return false; | 636 return false; |
637 } | 637 } |
638 | 638 |
639 } // namespace gpu | 639 } // namespace gpu |
OLD | NEW |