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

Side by Side Diff: ui/gl/gl_image_io_surface.mm

Issue 1434453008: cc: Fix R_8 GpuMemoryBuffers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove GetResourceTextureTarget 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
« no previous file with comments | « media/video/gpu_memory_buffer_video_frame_pool.cc ('k') | ui/gl/gl_image_memory.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ui/gl/gl_image_io_surface.h" 5 #include "ui/gl/gl_image_io_surface.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/mac/foundation_util.h" 10 #include "base/mac/foundation_util.h"
(...skipping 10 matching lines...) Expand all
21 using gfx::BufferFormat; 21 using gfx::BufferFormat;
22 22
23 namespace gl { 23 namespace gl {
24 namespace { 24 namespace {
25 25
26 using WidgetToLayerMap = std::map<gfx::AcceleratedWidget, CALayer*>; 26 using WidgetToLayerMap = std::map<gfx::AcceleratedWidget, CALayer*>;
27 base::LazyInstance<WidgetToLayerMap> g_widget_to_layer_map; 27 base::LazyInstance<WidgetToLayerMap> g_widget_to_layer_map;
28 28
29 bool ValidInternalFormat(unsigned internalformat) { 29 bool ValidInternalFormat(unsigned internalformat) {
30 switch (internalformat) { 30 switch (internalformat) {
31 case GL_R8: 31 case GL_RED:
32 case GL_BGRA_EXT: 32 case GL_BGRA_EXT:
33 case GL_RGB: 33 case GL_RGB:
34 case GL_RGB_YCBCR_422_CHROMIUM: 34 case GL_RGB_YCBCR_422_CHROMIUM:
35 case GL_RGBA: 35 case GL_RGBA:
36 return true; 36 return true;
37 default: 37 default:
38 return false; 38 return false;
39 } 39 }
40 } 40 }
41 41
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 // static 262 // static
263 void GLImageIOSurface::SetLayerForWidget(gfx::AcceleratedWidget widget, 263 void GLImageIOSurface::SetLayerForWidget(gfx::AcceleratedWidget widget,
264 CALayer* layer) { 264 CALayer* layer) {
265 if (layer) 265 if (layer)
266 g_widget_to_layer_map.Pointer()->insert(std::make_pair(widget, layer)); 266 g_widget_to_layer_map.Pointer()->insert(std::make_pair(widget, layer));
267 else 267 else
268 g_widget_to_layer_map.Pointer()->erase(widget); 268 g_widget_to_layer_map.Pointer()->erase(widget);
269 } 269 }
270 270
271 } // namespace gfx 271 } // namespace gfx
OLDNEW
« no previous file with comments | « media/video/gpu_memory_buffer_video_frame_pool.cc ('k') | ui/gl/gl_image_memory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698