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

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

Issue 1375663002: Show GpuMemoryBuffer feature in chrome://gpu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: display a matrix of formats and usages Created 5 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 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 c30afe09621e4dde6d2c4af7da5ec1ec8ce58289..51250bb0c1074b9ff11258519243792be7131d32 100644
--- a/content/browser/gpu/gpu_internals_ui.cc
+++ b/content/browser/gpu/gpu_internals_ui.cc
@@ -19,6 +19,7 @@
#include "base/strings/stringprintf.h"
#include "base/sys_info.h"
#include "base/values.h"
+#include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
#include "content/browser/gpu/compositor_util.h"
#include "content/browser/gpu/gpu_data_manager_impl.h"
#include "content/grit/content_resources.h"
@@ -232,6 +233,26 @@ base::DictionaryValue* GpuInfoAsDictionaryValue() {
return info;
}
+base::DictionaryValue* GmbInfoAsDictionaryValue() {
+ base::ListValue* gmb_info = new base::ListValue();
+ gmb_info->Append(NewDescriptionValuePair("Native Formats", "Usage"));
+
+ BrowserGpuMemoryBufferManager* gmb_manager =
+ BrowserGpuMemoryBufferManager::current();
+ GpuMemoryBufferConfigurationList list =
+ gmb_manager->GetNativeGpuMemoryBufferEnabledAndSupported();
+
+ GpuMemoryBufferConfigurationList::iterator it;
+ for (it = list.begin(); it != list.end(); it++)
+ gmb_info->Append(NewDescriptionValuePair(
+ BufferFormatToString(it->first), BufferUsageToString(it->second)));
+
+ base::DictionaryValue* info = new base::DictionaryValue();
+ info->Set("gmb_info", gmb_info);
+
+ return info;
+}
+
// This class receives javascript messages from the renderer.
// Note that the WebUI infrastructure runs on the UI thread, therefore all of
// this class's methods are expected to run on the UI thread.
@@ -409,6 +430,17 @@ void GpuMessageHandler::OnGpuInfoUpdate() {
// Send GPU Info to javascript.
web_ui()->CallJavascriptFunction("browserBridge.onGpuInfoUpdate",
*(gpu_info_val.get()));
+
+ // Get GpuMemoryBuffer Info.
+ scoped_ptr<base::DictionaryValue> gmb_info_val(GmbInfoAsDictionaryValue());
+
+ // Add in blacklisting features
+ base::DictionaryValue* gmb_status = new base::DictionaryValue;
+ gmb_info_val->Set("gbmStatus", gmb_status);
+
+ // Send GMB Info to javascript.
+ web_ui()->CallJavascriptFunction("browserBridge.onGmbInfoUpdate",
+ *(gmb_info_val.get()));
}
void GpuMessageHandler::OnGpuSwitched() {

Powered by Google App Engine
This is Rietveld 408576698