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

Side by Side Diff: content/browser/gpu/browser_gpu_channel_host_factory.cc

Issue 1097503003: ozone: OZONE_NATIVE_BUFFER requires GL_TEXTURE_EXTERNAL_OES. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improve comment Created 5 years, 8 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 | « no previous file | no next file » | 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/browser/gpu/browser_gpu_channel_host_factory.h" 5 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/profiler/scoped_tracker.h" 10 #include "base/profiler/scoped_tracker.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 260
261 std::vector<gfx::GpuMemoryBufferType> supported_types; 261 std::vector<gfx::GpuMemoryBufferType> supported_types;
262 GpuMemoryBufferFactory::GetSupportedTypes(&supported_types); 262 GpuMemoryBufferFactory::GetSupportedTypes(&supported_types);
263 DCHECK(!supported_types.empty()); 263 DCHECK(!supported_types.empty());
264 264
265 // The GPU service will always use the preferred type. 265 // The GPU service will always use the preferred type.
266 gfx::GpuMemoryBufferType type = supported_types[0]; 266 gfx::GpuMemoryBufferType type = supported_types[0];
267 267
268 switch (type) { 268 switch (type) {
269 case gfx::SURFACE_TEXTURE_BUFFER: 269 case gfx::SURFACE_TEXTURE_BUFFER:
270 // Surface texture backed GPU memory buffers require 270 case gfx::OZONE_NATIVE_BUFFER:
271 // GPU memory buffers that are shared with the GL using EGLImages require
271 // TEXTURE_EXTERNAL_OES. 272 // TEXTURE_EXTERNAL_OES.
272 return GL_TEXTURE_EXTERNAL_OES; 273 return GL_TEXTURE_EXTERNAL_OES;
273 case gfx::IO_SURFACE_BUFFER: 274 case gfx::IO_SURFACE_BUFFER:
274 // IOSurface backed images require GL_TEXTURE_RECTANGLE_ARB. 275 // IOSurface backed images require GL_TEXTURE_RECTANGLE_ARB.
275 return GL_TEXTURE_RECTANGLE_ARB; 276 return GL_TEXTURE_RECTANGLE_ARB;
276 default: 277 default:
277 return GL_TEXTURE_2D; 278 return GL_TEXTURE_2D;
278 } 279 }
279 } 280 }
280 281
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 DCHECK_CURRENTLY_ON(BrowserThread::IO); 559 DCHECK_CURRENTLY_ON(BrowserThread::IO);
559 560
560 CreateGpuMemoryBufferCallbackMap::iterator iter = 561 CreateGpuMemoryBufferCallbackMap::iterator iter =
561 create_gpu_memory_buffer_requests_.find(request_id); 562 create_gpu_memory_buffer_requests_.find(request_id);
562 DCHECK(iter != create_gpu_memory_buffer_requests_.end()); 563 DCHECK(iter != create_gpu_memory_buffer_requests_.end());
563 iter->second.Run(handle); 564 iter->second.Run(handle);
564 create_gpu_memory_buffer_requests_.erase(iter); 565 create_gpu_memory_buffer_requests_.erase(iter);
565 } 566 }
566 567
567 } // namespace content 568 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698