Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: components/mus/gles2/command_buffer_local.cc

Issue 1421903006: ui/gl: Move GLImage into gl namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ozone demo Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698