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

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

Issue 1375663002: Show GpuMemoryBuffer feature in chrome://gpu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WIP on reveman comments in #9 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/compositor_util.cc
diff --git a/content/browser/gpu/compositor_util.cc b/content/browser/gpu/compositor_util.cc
index 216d1da24b6c3facb393e0787fe4f765132f16d9..8ca8bb983282362bd31f8291e7beeb49fc2c8df2 100644
--- a/content/browser/gpu/compositor_util.cc
+++ b/content/browser/gpu/compositor_util.cc
@@ -30,6 +30,7 @@ const char* kGpuCompositingFeatureName = "gpu_compositing";
const char* kWebGLFeatureName = "webgl";
const char* kRasterizationFeatureName = "rasterization";
const char* kMultipleRasterThreadsFeatureName = "multiple_raster_threads";
+const char* kNativeGpuMemoryBufferFeatureName = "native_gpu_memory_buffers";
reveman 2015/10/16 18:37:43 s/GpuMemoryBuffer/GpuMemoryBuffers/
const int kMinRasterThreads = 1;
const int kMaxRasterThreads = 4;
@@ -156,6 +157,22 @@ const GpuFeatureInfo GetGpuFeatureInfo(size_t index, bool* eof) {
return kGpuFeatureInfo[index];
}
+const GpuFeatureInfo GetGpuGmbInfo(size_t index, bool* eof) {
+ const GpuFeatureInfo kGpuGmbInfo[] = {
+ {
+ kNativeGpuMemoryBufferFeatureName,
+ false,
+ !IsNativeGpuMemoryBufferEnabled(),
+ "GpuMemoryBuffers are using the fall back path through shared memory"
+ " instead the hardware backed one.",
+ true
+ },
+ };
+ DCHECK(index < arraysize(kGpuGmbInfo));
+ *eof = (index == arraysize(kGpuGmbInfo) - 1);
+ return kGpuGmbInfo[index];
+}
+
} // namespace
bool IsPropertyTreeVerificationEnabled() {
@@ -208,6 +225,11 @@ bool IsZeroCopyUploadEnabled() {
#endif
}
+bool IsNativeGpuMemoryBufferEnabled() {
reveman 2015/10/16 18:37:43 The logic used to determine if enable_native_gpu_m
+ const auto& command_line = *base::CommandLine::ForCurrentProcess();
+ return command_line.HasSwitch(switches::kEnableNativeGpuMemoryBuffers);
+}
+
bool IsPersistentGpuMemoryBufferEnabled() {
// Zero copy currently doesn't take advantage of persistent buffers.
if (IsZeroCopyUploadEnabled())
@@ -342,6 +364,25 @@ base::DictionaryValue* GetFeatureStatus() {
return feature_status_dict;
}
+base::DictionaryValue* GetGmbStatus() {
+ base::DictionaryValue* feature_status_dict = new base::DictionaryValue();
+
+ bool eof = false;
+ for (size_t i = 0; !eof; ++i) {
+ const GpuFeatureInfo gpu_gmb_info = GetGpuGmbInfo(i, &eof);
+ std::string status;
+ if (gpu_gmb_info.disabled) {
+ status = "disabled_software";
+ } else {
+ status = "enabled_on";
+ }
+
+ feature_status_dict->SetString(
+ gpu_gmb_info.name.c_str(), status.c_str());
+ }
+ return feature_status_dict;
+}
+
base::Value* GetProblems() {
GpuDataManagerImpl* manager = GpuDataManagerImpl::GetInstance();
std::string gpu_access_blocked_reason;

Powered by Google App Engine
This is Rietveld 408576698