| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "cc/test/test_gpu_memory_buffer_manager.h" | 5 #include "cc/test/test_gpu_memory_buffer_manager.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/numerics/safe_conversions.h" | 8 #include "base/numerics/safe_conversions.h" |
| 9 #include "ui/gfx/buffer_format_util.h" | 9 #include "ui/gfx/buffer_format_util.h" |
| 10 #include "ui/gfx/gpu_memory_buffer.h" | 10 #include "ui/gfx/gpu_memory_buffer.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 gfx::BufferFormat GetFormat() const override { return format_; } | 116 gfx::BufferFormat GetFormat() const override { return format_; } |
| 117 void GetStride(int* stride) const override { | 117 void GetStride(int* stride) const override { |
| 118 int num_planes = | 118 int num_planes = |
| 119 static_cast<int>(gfx::NumberOfPlanesForBufferFormat(format_)); | 119 static_cast<int>(gfx::NumberOfPlanesForBufferFormat(format_)); |
| 120 for (int i = 0; i < num_planes; ++i) | 120 for (int i = 0; i < num_planes; ++i) |
| 121 stride[i] = | 121 stride[i] = |
| 122 base::checked_cast<int>(StrideInBytes(size_.width(), format_, i)); | 122 base::checked_cast<int>(StrideInBytes(size_.width(), format_, i)); |
| 123 } | 123 } |
| 124 gfx::GpuMemoryBufferId GetId() const override { | 124 gfx::GpuMemoryBufferId GetId() const override { |
| 125 NOTREACHED(); | 125 NOTREACHED(); |
| 126 return 0; | 126 return gfx::GpuMemoryBufferId(0); |
| 127 } | 127 } |
| 128 gfx::GpuMemoryBufferHandle GetHandle() const override { | 128 gfx::GpuMemoryBufferHandle GetHandle() const override { |
| 129 gfx::GpuMemoryBufferHandle handle; | 129 gfx::GpuMemoryBufferHandle handle; |
| 130 handle.type = gfx::SHARED_MEMORY_BUFFER; | 130 handle.type = gfx::SHARED_MEMORY_BUFFER; |
| 131 handle.handle = shared_memory_->handle(); | 131 handle.handle = shared_memory_->handle(); |
| 132 return handle; | 132 return handle; |
| 133 } | 133 } |
| 134 ClientBuffer AsClientBuffer() override { | 134 ClientBuffer AsClientBuffer() override { |
| 135 return reinterpret_cast<ClientBuffer>(this); | 135 return reinterpret_cast<ClientBuffer>(this); |
| 136 } | 136 } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 166 ClientBuffer buffer) { | 166 ClientBuffer buffer) { |
| 167 return reinterpret_cast<gfx::GpuMemoryBuffer*>(buffer); | 167 return reinterpret_cast<gfx::GpuMemoryBuffer*>(buffer); |
| 168 } | 168 } |
| 169 | 169 |
| 170 void TestGpuMemoryBufferManager::SetDestructionSyncPoint( | 170 void TestGpuMemoryBufferManager::SetDestructionSyncPoint( |
| 171 gfx::GpuMemoryBuffer* buffer, | 171 gfx::GpuMemoryBuffer* buffer, |
| 172 uint32 sync_point) { | 172 uint32 sync_point) { |
| 173 } | 173 } |
| 174 | 174 |
| 175 } // namespace cc | 175 } // namespace cc |
| OLD | NEW |