OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/mus/gles2/command_buffer_local.h" | 5 #include "components/mus/gles2/command_buffer_local.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/shared_memory.h" | 8 #include "base/memory/shared_memory.h" |
9 #include "components/mus/gles2/command_buffer_local_client.h" | 9 #include "components/mus/gles2/command_buffer_local_client.h" |
10 #include "components/mus/gles2/gpu_memory_tracker.h" | 10 #include "components/mus/gles2/gpu_memory_tracker.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 } | 159 } |
160 | 160 |
161 int32_t CommandBufferLocal::CreateGpuMemoryBufferImage(size_t width, | 161 int32_t CommandBufferLocal::CreateGpuMemoryBufferImage(size_t width, |
162 size_t height, | 162 size_t height, |
163 unsigned internalformat, | 163 unsigned internalformat, |
164 unsigned usage) { | 164 unsigned usage) { |
165 DCHECK_EQ(usage, static_cast<unsigned>(GL_READ_WRITE_CHROMIUM)); | 165 DCHECK_EQ(usage, static_cast<unsigned>(GL_READ_WRITE_CHROMIUM)); |
166 scoped_ptr<gfx::GpuMemoryBuffer> buffer(MojoGpuMemoryBufferImpl::Create( | 166 scoped_ptr<gfx::GpuMemoryBuffer> buffer(MojoGpuMemoryBufferImpl::Create( |
167 gfx::Size(static_cast<int>(width), static_cast<int>(height)), | 167 gfx::Size(static_cast<int>(width), static_cast<int>(height)), |
168 gpu::ImageFactory::DefaultBufferFormatForImageFormat(internalformat), | 168 gpu::ImageFactory::DefaultBufferFormatForImageFormat(internalformat), |
169 gfx::BufferUsage::GPU_READ_WRITE)); | 169 gfx::BufferUsage::SCANOUT)); |
170 if (!buffer) | 170 if (!buffer) |
171 return -1; | 171 return -1; |
172 return CreateImage(buffer->AsClientBuffer(), width, height, internalformat); | 172 return CreateImage(buffer->AsClientBuffer(), width, height, internalformat); |
173 } | 173 } |
174 | 174 |
175 uint32_t CommandBufferLocal::InsertSyncPoint() { | 175 uint32_t CommandBufferLocal::InsertSyncPoint() { |
176 return 0; | 176 return 0; |
177 } | 177 } |
178 | 178 |
179 uint32_t CommandBufferLocal::InsertFutureSyncPoint() { | 179 uint32_t CommandBufferLocal::InsertFutureSyncPoint() { |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 void CommandBufferLocal::OnContextLost(uint32_t reason) { | 328 void CommandBufferLocal::OnContextLost(uint32_t reason) { |
329 if (client_) | 329 if (client_) |
330 client_->DidLoseContext(); | 330 client_->DidLoseContext(); |
331 } | 331 } |
332 | 332 |
333 void CommandBufferLocal::OnSyncPointRetired() { | 333 void CommandBufferLocal::OnSyncPointRetired() { |
334 scheduler_->SetScheduled(true); | 334 scheduler_->SetScheduled(true); |
335 } | 335 } |
336 | 336 |
337 } // namespace mus | 337 } // namespace mus |
OLD | NEW |