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

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

Issue 948323002: Revert of Add support for compressed GPU memory buffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « content/common/gpu/gpu_command_buffer_stub.cc ('k') | gpu/command_buffer/common/capabilities.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_memory_buffer_factory_io_surface.h" 5 #include "content/common/gpu/gpu_memory_buffer_factory_io_surface.h"
6 6
7 #include <CoreFoundation/CoreFoundation.h> 7 #include <CoreFoundation/CoreFoundation.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/gl/gl_image_io_surface.h" 10 #include "ui/gl/gl_image_io_surface.h"
(...skipping 13 matching lines...) Expand all
24 int32 value) { 24 int32 value) {
25 base::ScopedCFTypeRef<CFNumberRef> number( 25 base::ScopedCFTypeRef<CFNumberRef> number(
26 CFNumberCreate(NULL, kCFNumberSInt32Type, &value)); 26 CFNumberCreate(NULL, kCFNumberSInt32Type, &value));
27 CFDictionaryAddValue(dictionary, key, number.get()); 27 CFDictionaryAddValue(dictionary, key, number.get());
28 } 28 }
29 29
30 int32 BytesPerPixel(gfx::GpuMemoryBuffer::Format format) { 30 int32 BytesPerPixel(gfx::GpuMemoryBuffer::Format format) {
31 switch (format) { 31 switch (format) {
32 case gfx::GpuMemoryBuffer::BGRA_8888: 32 case gfx::GpuMemoryBuffer::BGRA_8888:
33 return 4; 33 return 4;
34 case gfx::GpuMemoryBuffer::ATC:
35 case gfx::GpuMemoryBuffer::ATCIA:
36 case gfx::GpuMemoryBuffer::DXT1:
37 case gfx::GpuMemoryBuffer::DXT5:
38 case gfx::GpuMemoryBuffer::ETC1:
39 case gfx::GpuMemoryBuffer::RGBA_8888: 34 case gfx::GpuMemoryBuffer::RGBA_8888:
40 case gfx::GpuMemoryBuffer::RGBX_8888: 35 case gfx::GpuMemoryBuffer::RGBX_8888:
41 NOTREACHED(); 36 NOTREACHED();
42 return 0; 37 return 0;
43 } 38 }
44 39
45 NOTREACHED(); 40 NOTREACHED();
46 return 0; 41 return 0;
47 } 42 }
48 43
49 int32 PixelFormat(gfx::GpuMemoryBuffer::Format format) { 44 int32 PixelFormat(gfx::GpuMemoryBuffer::Format format) {
50 switch (format) { 45 switch (format) {
51 case gfx::GpuMemoryBuffer::BGRA_8888: 46 case gfx::GpuMemoryBuffer::BGRA_8888:
52 return 'BGRA'; 47 return 'BGRA';
53 case gfx::GpuMemoryBuffer::ATC:
54 case gfx::GpuMemoryBuffer::ATCIA:
55 case gfx::GpuMemoryBuffer::DXT1:
56 case gfx::GpuMemoryBuffer::DXT5:
57 case gfx::GpuMemoryBuffer::ETC1:
58 case gfx::GpuMemoryBuffer::RGBA_8888: 48 case gfx::GpuMemoryBuffer::RGBA_8888:
59 case gfx::GpuMemoryBuffer::RGBX_8888: 49 case gfx::GpuMemoryBuffer::RGBX_8888:
60 NOTREACHED(); 50 NOTREACHED();
61 return 0; 51 return 0;
62 } 52 }
63 53
64 NOTREACHED(); 54 NOTREACHED();
65 return 0; 55 return 0;
66 } 56 }
67 57
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 return scoped_refptr<gfx::GLImage>(); 157 return scoped_refptr<gfx::GLImage>();
168 158
169 scoped_refptr<gfx::GLImageIOSurface> image(new gfx::GLImageIOSurface(size)); 159 scoped_refptr<gfx::GLImageIOSurface> image(new gfx::GLImageIOSurface(size));
170 if (!image->Initialize(it->second.get())) 160 if (!image->Initialize(it->second.get()))
171 return scoped_refptr<gfx::GLImage>(); 161 return scoped_refptr<gfx::GLImage>();
172 162
173 return image; 163 return image;
174 } 164 }
175 165
176 } // namespace content 166 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.cc ('k') | gpu/command_buffer/common/capabilities.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698