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

Unified Diff: content/browser/gpu/browser_gpu_memory_buffer_manager.cc

Issue 1643293002: BrowserGpuMemoryBufferManager::IsNativeGpuMemoryBuffersEnabled() return true if at least one native… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/browser_gpu_memory_buffer_manager.cc
diff --git a/content/browser/gpu/browser_gpu_memory_buffer_manager.cc b/content/browser/gpu/browser_gpu_memory_buffer_manager.cc
index d9c25c9344bb68d8093ee2ac849a41dd27c81a3a..951cfef5d9517797e2bf87de71e0155ae9110a42 100644
--- a/content/browser/gpu/browser_gpu_memory_buffer_manager.cc
+++ b/content/browser/gpu/browser_gpu_memory_buffer_manager.cc
@@ -102,10 +102,26 @@ bool IsNativeGpuMemoryBufferFactoryConfigurationSupported(
}
}
-GpuMemoryBufferConfigurationSet GetNativeGpuMemoryBufferConfigurations() {
- GpuMemoryBufferConfigurationSet configurations;
+GpuMemoryBufferConfigurationSet
+GetNativeGpuMemoryBufferConfigurationsForTileUpdate() {
+ // Disable native buffers when using Mesa.
+ if (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kUseGL) == gfx::kGLImplementationOSMesaName) {
+ return GpuMemoryBufferConfigurationSet();
+ }
- if (BrowserGpuMemoryBufferManager::IsNativeGpuMemoryBuffersEnabled()) {
+#if defined(OS_MACOSX)
+ bool enabled_in_command_line =
+ !base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableNativeGpuMemoryBuffers);
+#else
+ bool enabled_in_command_line =
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableNativeGpuMemoryBuffers);
+#endif
+
+ GpuMemoryBufferConfigurationSet configurations;
+ if (enabled_in_command_line) {
const gfx::BufferFormat kNativeFormats[] = {
gfx::BufferFormat::R_8, gfx::BufferFormat::RGBA_4444,
gfx::BufferFormat::RGBA_8888, gfx::BufferFormat::BGRA_8888,
@@ -122,6 +138,13 @@ GpuMemoryBufferConfigurationSet GetNativeGpuMemoryBufferConfigurations() {
}
}
+ return configurations;
+}
+
+GpuMemoryBufferConfigurationSet GetNativeGpuMemoryBufferConfigurations() {
+ GpuMemoryBufferConfigurationSet configurations =
+ GetNativeGpuMemoryBufferConfigurationsForTileUpdate();
+
#if defined(USE_OZONE) || defined(OS_MACOSX)
// Disable native buffers only when using Mesa.
bool force_native_gpu_read_write_formats =
@@ -213,19 +236,9 @@ BrowserGpuMemoryBufferManager* BrowserGpuMemoryBufferManager::current() {
// static
bool BrowserGpuMemoryBufferManager::IsNativeGpuMemoryBuffersEnabled() {
- // Disable native buffers when using Mesa.
- if (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- switches::kUseGL) == gfx::kGLImplementationOSMesaName) {
- return false;
- }
-
-#if defined(OS_MACOSX)
- return !base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableNativeGpuMemoryBuffers);
-#else
- return base::CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableNativeGpuMemoryBuffers);
-#endif
+ GpuMemoryBufferConfigurationSet configurations =
+ GetNativeGpuMemoryBufferConfigurationsForTileUpdate();
+ return !configurations.empty();
}
// static
« 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