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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 } | 130 } |
131 | 131 |
132 int32_t CommandBufferLocal::CreateImage(ClientBuffer buffer, | 132 int32_t CommandBufferLocal::CreateImage(ClientBuffer buffer, |
133 size_t width, | 133 size_t width, |
134 size_t height, | 134 size_t height, |
135 unsigned internalformat) { | 135 unsigned internalformat) { |
136 MojoGpuMemoryBufferImpl* gpu_memory_buffer = | 136 MojoGpuMemoryBufferImpl* gpu_memory_buffer = |
137 MojoGpuMemoryBufferImpl::FromClientBuffer(buffer); | 137 MojoGpuMemoryBufferImpl::FromClientBuffer(buffer); |
138 | 138 |
139 gfx::GpuMemoryBufferHandle handle = gpu_memory_buffer->GetHandle(); | 139 gfx::GpuMemoryBufferHandle handle = gpu_memory_buffer->GetHandle(); |
140 scoped_refptr<gfx::GLImageSharedMemory> image(new gfx::GLImageSharedMemory( | 140 scoped_refptr<gl::GLImageSharedMemory> image(new gl::GLImageSharedMemory( |
141 gfx::Size(static_cast<int>(width), static_cast<int>(height)), | 141 gfx::Size(static_cast<int>(width), static_cast<int>(height)), |
142 internalformat)); | 142 internalformat)); |
143 if (!image->Initialize(base::SharedMemory::DuplicateHandle(handle.handle), | 143 if (!image->Initialize(base::SharedMemory::DuplicateHandle(handle.handle), |
144 handle.id, gpu_memory_buffer->GetFormat(), 0)) { | 144 handle.id, gpu_memory_buffer->GetFormat(), 0)) { |
145 return -1; | 145 return -1; |
146 } | 146 } |
147 | 147 |
148 static int32 next_id = 1; | 148 static int32 next_id = 1; |
149 int32 new_id = next_id++; | 149 int32 new_id = next_id++; |
150 | 150 |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 void CommandBufferLocal::OnContextLost(uint32_t reason) { | 334 void CommandBufferLocal::OnContextLost(uint32_t reason) { |
335 if (client_) | 335 if (client_) |
336 client_->DidLoseContext(); | 336 client_->DidLoseContext(); |
337 } | 337 } |
338 | 338 |
339 void CommandBufferLocal::OnSyncPointRetired() { | 339 void CommandBufferLocal::OnSyncPointRetired() { |
340 scheduler_->SetScheduled(true); | 340 scheduler_->SetScheduled(true); |
341 } | 341 } |
342 | 342 |
343 } // namespace mus | 343 } // namespace mus |
OLD | NEW |