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

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

Issue 1219603002: Revert of content: Enable native GpuMemoryBuffers by default on MacOSX. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | content/child/child_thread_impl_browsertest.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 "base/atomic_sequence_num.h" 7 #include "base/atomic_sequence_num.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 GpuMemoryBufferFactory::GetSupportedTypes(&supported_types); 80 GpuMemoryBufferFactory::GetSupportedTypes(&supported_types);
81 DCHECK(!supported_types.empty()); 81 DCHECK(!supported_types.empty());
82 82
83 // The GPU service will always use the preferred type. 83 // The GPU service will always use the preferred type.
84 return supported_types[0]; 84 return supported_types[0];
85 } 85 }
86 86
87 std::vector<GpuMemoryBufferFactory::Configuration> 87 std::vector<GpuMemoryBufferFactory::Configuration>
88 GetSupportedGpuMemoryBufferConfigurations(gfx::GpuMemoryBufferType type) { 88 GetSupportedGpuMemoryBufferConfigurations(gfx::GpuMemoryBufferType type) {
89 std::vector<GpuMemoryBufferFactory::Configuration> configurations; 89 std::vector<GpuMemoryBufferFactory::Configuration> configurations;
90 #if defined(OS_MACOSX) 90 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
91 bool enable_native_gpu_memory_buffers = 91 switches::kEnableNativeGpuMemoryBuffers)) {
92 !base::CommandLine::ForCurrentProcess()->HasSwitch(
93 switches::kDisableNativeGpuMemoryBuffers);
94 #else
95 bool enable_native_gpu_memory_buffers =
96 base::CommandLine::ForCurrentProcess()->HasSwitch(
97 switches::kEnableNativeGpuMemoryBuffers);
98 #endif
99 if (enable_native_gpu_memory_buffers) {
100 const GpuMemoryBufferFactory::Configuration kNativeConfigurations[] = { 92 const GpuMemoryBufferFactory::Configuration kNativeConfigurations[] = {
101 {gfx::GpuMemoryBuffer::R_8, gfx::GpuMemoryBuffer::MAP}, 93 {gfx::GpuMemoryBuffer::R_8, gfx::GpuMemoryBuffer::MAP},
102 {gfx::GpuMemoryBuffer::R_8, gfx::GpuMemoryBuffer::PERSISTENT_MAP}, 94 {gfx::GpuMemoryBuffer::R_8, gfx::GpuMemoryBuffer::PERSISTENT_MAP},
103 {gfx::GpuMemoryBuffer::RGBA_4444, gfx::GpuMemoryBuffer::MAP}, 95 {gfx::GpuMemoryBuffer::RGBA_4444, gfx::GpuMemoryBuffer::MAP},
104 {gfx::GpuMemoryBuffer::RGBA_4444, gfx::GpuMemoryBuffer::PERSISTENT_MAP}, 96 {gfx::GpuMemoryBuffer::RGBA_4444, gfx::GpuMemoryBuffer::PERSISTENT_MAP},
105 {gfx::GpuMemoryBuffer::RGBA_8888, gfx::GpuMemoryBuffer::MAP}, 97 {gfx::GpuMemoryBuffer::RGBA_8888, gfx::GpuMemoryBuffer::MAP},
106 {gfx::GpuMemoryBuffer::RGBA_8888, gfx::GpuMemoryBuffer::PERSISTENT_MAP}, 98 {gfx::GpuMemoryBuffer::RGBA_8888, gfx::GpuMemoryBuffer::PERSISTENT_MAP},
107 {gfx::GpuMemoryBuffer::BGRA_8888, gfx::GpuMemoryBuffer::MAP}, 99 {gfx::GpuMemoryBuffer::BGRA_8888, gfx::GpuMemoryBuffer::MAP},
108 {gfx::GpuMemoryBuffer::BGRA_8888, 100 {gfx::GpuMemoryBuffer::BGRA_8888,
109 gfx::GpuMemoryBuffer::PERSISTENT_MAP}}; 101 gfx::GpuMemoryBuffer::PERSISTENT_MAP}};
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 } 560 }
569 561
570 GpuProcessHost* host = GpuProcessHost::FromID(buffer_it->second.gpu_host_id); 562 GpuProcessHost* host = GpuProcessHost::FromID(buffer_it->second.gpu_host_id);
571 if (host) 563 if (host)
572 host->DestroyGpuMemoryBuffer(id, client_id, sync_point); 564 host->DestroyGpuMemoryBuffer(id, client_id, sync_point);
573 565
574 buffers.erase(buffer_it); 566 buffers.erase(buffer_it);
575 } 567 }
576 568
577 } // namespace content 569 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/child/child_thread_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698