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

Side by Side Diff: content/common/gpu/gpu_channel.cc

Issue 1354483004: Re-land: ui: Add GLImage unit test framework. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 2 months 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
« no previous file with comments | « components/mus/vm/BUILD.gn ('k') | content/common/gpu/gpu_memory_buffer_factory_io_surface.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "content/common/gpu/gpu_channel.h" 5 #include "content/common/gpu/gpu_channel.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #endif 9 #endif
10 10
(...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 1035
1036 scoped_refptr<gfx::GLImage> GpuChannel::CreateImageForGpuMemoryBuffer( 1036 scoped_refptr<gfx::GLImage> GpuChannel::CreateImageForGpuMemoryBuffer(
1037 const gfx::GpuMemoryBufferHandle& handle, 1037 const gfx::GpuMemoryBufferHandle& handle,
1038 const gfx::Size& size, 1038 const gfx::Size& size,
1039 gfx::BufferFormat format, 1039 gfx::BufferFormat format,
1040 uint32 internalformat) { 1040 uint32 internalformat) {
1041 switch (handle.type) { 1041 switch (handle.type) {
1042 case gfx::SHARED_MEMORY_BUFFER: { 1042 case gfx::SHARED_MEMORY_BUFFER: {
1043 scoped_refptr<gfx::GLImageSharedMemory> image( 1043 scoped_refptr<gfx::GLImageSharedMemory> image(
1044 new gfx::GLImageSharedMemory(size, internalformat)); 1044 new gfx::GLImageSharedMemory(size, internalformat));
1045 if (!image->Initialize(handle, format)) 1045 if (!image->Initialize(handle.handle, handle.id, format))
1046 return scoped_refptr<gfx::GLImage>(); 1046 return scoped_refptr<gfx::GLImage>();
1047 1047
1048 return image; 1048 return image;
1049 } 1049 }
1050 default: { 1050 default: {
1051 GpuChannelManager* manager = gpu_channel_manager(); 1051 GpuChannelManager* manager = gpu_channel_manager();
1052 if (!manager->gpu_memory_buffer_factory()) 1052 if (!manager->gpu_memory_buffer_factory())
1053 return scoped_refptr<gfx::GLImage>(); 1053 return scoped_refptr<gfx::GLImage>();
1054 1054
1055 return manager->gpu_memory_buffer_factory() 1055 return manager->gpu_memory_buffer_factory()
1056 ->AsImageFactory() 1056 ->AsImageFactory()
1057 ->CreateImageForGpuMemoryBuffer(handle, 1057 ->CreateImageForGpuMemoryBuffer(handle,
1058 size, 1058 size,
1059 format, 1059 format,
1060 internalformat, 1060 internalformat,
1061 client_id_); 1061 client_id_);
1062 } 1062 }
1063 } 1063 }
1064 } 1064 }
1065 1065
1066 void GpuChannel::HandleUpdateValueState( 1066 void GpuChannel::HandleUpdateValueState(
1067 unsigned int target, const gpu::ValueState& state) { 1067 unsigned int target, const gpu::ValueState& state) {
1068 pending_valuebuffer_state_->UpdateState(target, state); 1068 pending_valuebuffer_state_->UpdateState(target, state);
1069 } 1069 }
1070 1070
1071 } // namespace content 1071 } // namespace content
OLDNEW
« no previous file with comments | « components/mus/vm/BUILD.gn ('k') | content/common/gpu/gpu_memory_buffer_factory_io_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698