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

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

Issue 2376293003: gpu: support RG_88 GpuMemoryBuffer (Closed)
Patch Set: resolve hubbe's review Created 4 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/exo/buffer.cc ('k') | content/browser/gpu/gpu_internals_ui.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 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/browser/gpu/browser_gpu_memory_buffer_manager.h" 5 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 const gpu::SyncToken& sync_token) { 49 const gpu::SyncToken& sync_token) {
50 destruction_task_runner->PostTask( 50 destruction_task_runner->PostTask(
51 FROM_HERE, base::Bind(destruction_callback, sync_token)); 51 FROM_HERE, base::Bind(destruction_callback, sync_token));
52 } 52 }
53 53
54 GpuMemoryBufferConfigurationSet GetNativeGpuMemoryBufferConfigurations() { 54 GpuMemoryBufferConfigurationSet GetNativeGpuMemoryBufferConfigurations() {
55 GpuMemoryBufferConfigurationSet configurations; 55 GpuMemoryBufferConfigurationSet configurations;
56 56
57 if (BrowserGpuMemoryBufferManager::IsNativeGpuMemoryBuffersEnabled()) { 57 if (BrowserGpuMemoryBufferManager::IsNativeGpuMemoryBuffersEnabled()) {
58 const gfx::BufferFormat kNativeFormats[] = { 58 const gfx::BufferFormat kNativeFormats[] = {
59 gfx::BufferFormat::R_8, gfx::BufferFormat::BGR_565, 59 gfx::BufferFormat::R_8,
60 gfx::BufferFormat::RGBA_4444, gfx::BufferFormat::RGBA_8888, 60 gfx::BufferFormat::RG_88,
61 gfx::BufferFormat::BGRA_8888, gfx::BufferFormat::UYVY_422, 61 gfx::BufferFormat::BGR_565,
62 gfx::BufferFormat::YVU_420, gfx::BufferFormat::YUV_420_BIPLANAR}; 62 gfx::BufferFormat::RGBA_4444,
63 gfx::BufferFormat::RGBA_8888,
64 gfx::BufferFormat::BGRA_8888,
65 gfx::BufferFormat::UYVY_422,
66 gfx::BufferFormat::YVU_420,
67 gfx::BufferFormat::YUV_420_BIPLANAR};
63 const gfx::BufferUsage kNativeUsages[] = { 68 const gfx::BufferUsage kNativeUsages[] = {
64 gfx::BufferUsage::GPU_READ, gfx::BufferUsage::SCANOUT, 69 gfx::BufferUsage::GPU_READ, gfx::BufferUsage::SCANOUT,
65 gfx::BufferUsage::GPU_READ_CPU_READ_WRITE, 70 gfx::BufferUsage::GPU_READ_CPU_READ_WRITE,
66 gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT}; 71 gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT};
67 for (auto& format : kNativeFormats) { 72 for (auto& format : kNativeFormats) {
68 for (auto& usage : kNativeUsages) { 73 for (auto& usage : kNativeUsages) {
69 if (gpu::IsNativeGpuMemoryBufferConfigurationSupported(format, usage)) 74 if (gpu::IsNativeGpuMemoryBufferConfigurationSupported(format, usage))
70 configurations.insert(std::make_pair(format, usage)); 75 configurations.insert(std::make_pair(format, usage));
71 } 76 }
72 } 77 }
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 format(format), 685 format(format),
681 usage(usage), 686 usage(usage),
682 gpu_host_id(gpu_host_id) {} 687 gpu_host_id(gpu_host_id) {}
683 688
684 BrowserGpuMemoryBufferManager::BufferInfo::BufferInfo(const BufferInfo& other) = 689 BrowserGpuMemoryBufferManager::BufferInfo::BufferInfo(const BufferInfo& other) =
685 default; 690 default;
686 691
687 BrowserGpuMemoryBufferManager::BufferInfo::~BufferInfo() {} 692 BrowserGpuMemoryBufferManager::BufferInfo::~BufferInfo() {}
688 693
689 } // namespace content 694 } // namespace content
OLDNEW
« no previous file with comments | « components/exo/buffer.cc ('k') | content/browser/gpu/gpu_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698