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

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

Issue 9965096: Revert 130298 - Revert 130258 - Make it possible to blacklist gpu's based on the Windows experience… (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1025/src/
Patch Set: Created 8 years, 9 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 | « content/browser/gpu/gpu_performance_stats.cc ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/gpu_performance_stats_win.cc
===================================================================
--- content/browser/gpu/gpu_performance_stats_win.cc (revision 130298)
+++ content/browser/gpu/gpu_performance_stats_win.cc (working copy)
@@ -1,68 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/browser/gpu/gpu_performance_stats.h"
-
-#include <winsatcominterfacei.h>
-
-static float GetComponentScore(IProvideWinSATAssessmentInfo* subcomponent) {
- float score;
- HRESULT hr = subcomponent->get_Score(&score);
- if (FAILED(hr))
- return 0.0;
- return score;
-}
-
-GpuPerformanceStats GpuPerformanceStats::RetrieveGpuPerformanceStats() {
- HRESULT hr = S_OK;
- IQueryRecentWinSATAssessment* assessment = NULL;
- IProvideWinSATResultsInfo* results = NULL;
- IProvideWinSATAssessmentInfo* subcomponent = NULL;
- GpuPerformanceStats stats;
-
- hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
- if (FAILED(hr))
- goto cleanup;
-
- hr = CoCreateInstance(__uuidof(CQueryWinSAT),
- NULL,
- CLSCTX_INPROC_SERVER,
- __uuidof(IQueryRecentWinSATAssessment),
- reinterpret_cast<void**>(&assessment));
- if (FAILED(hr))
- goto cleanup;
-
- hr = assessment->get_Info(&results);
- if (FAILED(hr))
- goto cleanup;
-
- hr = results->get_SystemRating(&stats.overall);
- if (FAILED(hr))
- goto cleanup;
-
- hr = results->GetAssessmentInfo(WINSAT_ASSESSMENT_D3D, &subcomponent);
- if (FAILED(hr))
- goto cleanup;
- stats.gaming = GetComponentScore(subcomponent);
- subcomponent->Release();
- subcomponent = NULL;
-
- hr = results->GetAssessmentInfo(WINSAT_ASSESSMENT_GRAPHICS, &subcomponent);
- if (FAILED(hr))
- goto cleanup;
- stats.graphics = GetComponentScore(subcomponent);
- subcomponent->Release();
- subcomponent = NULL;
-
- cleanup:
- if (assessment)
- assessment->Release();
- if (results)
- results->Release();
- if (subcomponent)
- subcomponent->Release();
- CoUninitialize();
-
- return stats;
-}
« no previous file with comments | « content/browser/gpu/gpu_performance_stats.cc ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698