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

Side by Side Diff: content/common/gpu/gpu_channel.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 (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 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 // Sum the memory usage for all unique memory trackers. 1026 // Sum the memory usage for all unique memory trackers.
1027 uint64 size = 0; 1027 uint64 size = 0;
1028 for (auto* tracker : unique_memory_trackers) { 1028 for (auto* tracker : unique_memory_trackers) {
1029 size += gpu_channel_manager()->gpu_memory_manager()->GetTrackerMemoryUsage( 1029 size += gpu_channel_manager()->gpu_memory_manager()->GetTrackerMemoryUsage(
1030 tracker); 1030 tracker);
1031 } 1031 }
1032 1032
1033 return size; 1033 return size;
1034 } 1034 }
1035 1035
1036 scoped_refptr<gfx::GLImage> GpuChannel::CreateImageForGpuMemoryBuffer( 1036 scoped_refptr<gl::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<gl::GLImageSharedMemory> image(
1044 new gfx::GLImageSharedMemory(size, internalformat)); 1044 new gl::GLImageSharedMemory(size, internalformat));
1045 if (!image->Initialize(handle.handle, handle.id, format, handle.offset)) 1045 if (!image->Initialize(handle.handle, handle.id, format, handle.offset))
1046 return nullptr; 1046 return nullptr;
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 nullptr; 1053 return nullptr;
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

Powered by Google App Engine
This is Rietveld 408576698