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

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

Issue 1637423004: Show Compositor information in chrome://gpu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add Compositor Information section 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
Index: content/browser/gpu/gpu_internals_ui.cc
diff --git a/content/browser/gpu/gpu_internals_ui.cc b/content/browser/gpu/gpu_internals_ui.cc
index c32b27e11238ad882401a88cc8d2a3599dc1f7bc..3e1f9ad24bdf1ac85b64212e4692ab9ac6d4285b 100644
--- a/content/browser/gpu/gpu_internals_ui.cc
+++ b/content/browser/gpu/gpu_internals_ui.cc
@@ -302,7 +302,31 @@ const char* BufferUsageToString(gfx::BufferUsage usage) {
return nullptr;
}
-base::DictionaryValue* GpuMemoryBufferInfoAsDictionaryValue() {
+base::ListValue* CompositorInfo() {
+ base::ListValue* compositor_info = new base::ListValue();
+
+ // Add Tile Update Mode.
+ std::string tile_update_mode;
+ if (BrowserGpuMemoryBufferManager::IsNativeGpuMemoryBuffersEnabled()) {
reveman 2016/01/29 19:49:07 Don't include this here. This information is alrea
dshwang 2016/01/29 19:58:40 Done.
+ tile_update_mode = "Native, ";
+ } else {
+ tile_update_mode = "Software, ";
+ }
+ if (IsZeroCopyUploadEnabled()) {
+ tile_update_mode += "Zero-copy";
+ } else {
+ tile_update_mode += "One-copy";
+ }
+ compositor_info->Append(
+ NewDescriptionValuePair("Tile Update Mode", tile_update_mode));
+
+ // Add Partial Raster
+ compositor_info->Append(NewDescriptionValuePair(
+ "Partial Raster", IsPartialRasterEnabled() ? "Enabled" : "Disabled"));
+ return compositor_info;
+}
+
+base::ListValue* GpuMemoryBufferInfo() {
base::ListValue* gpu_memory_buffer_info = new base::ListValue();
BrowserGpuMemoryBufferManager* gpu_memory_buffer_manager =
@@ -328,11 +352,7 @@ base::DictionaryValue* GpuMemoryBufferInfoAsDictionaryValue() {
BufferFormatToString(static_cast<gfx::BufferFormat>(format)),
native_usage_support));
}
-
- base::DictionaryValue* info = new base::DictionaryValue();
- info->Set("gpu_memory_buffer_info", gpu_memory_buffer_info);
-
- return info;
+ return gpu_memory_buffer_info;
}
// This class receives javascript messages from the renderer.
@@ -508,18 +528,12 @@ void GpuMessageHandler::OnGpuInfoUpdate() {
workarounds->AppendString(workaround);
feature_status->Set("workarounds", workarounds);
gpu_info_val->Set("featureStatus", feature_status);
+ gpu_info_val->Set("compositorInfo", CompositorInfo());
+ gpu_info_val->Set("gpuMemoryBufferInfo", GpuMemoryBufferInfo());
// Send GPU Info to javascript.
web_ui()->CallJavascriptFunction("browserBridge.onGpuInfoUpdate",
*(gpu_info_val.get()));
-
- // Get GpuMemoryBuffer Info.
- scoped_ptr<base::DictionaryValue> gpu_memory_buffer_info_val(
- GpuMemoryBufferInfoAsDictionaryValue());
-
- // Send GpuMemoryBuffer Info to javascript.
- web_ui()->CallJavascriptFunction("browserBridge.onGpuMemoryBufferInfoUpdate",
- *(gpu_memory_buffer_info_val.get()));
}
void GpuMessageHandler::OnGpuSwitched() {

Powered by Google App Engine
This is Rietveld 408576698