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

Unified Diff: ui/surface/accelerated_surface_win.cc

Issue 10836018: Add command-line option to have an extra delay before blitting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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: ui/surface/accelerated_surface_win.cc
diff --git a/ui/surface/accelerated_surface_win.cc b/ui/surface/accelerated_surface_win.cc
index 698f5fcd3d3dbb53c5c241514b1bb8c9de93187c..f4e6c9cbee6c14a7adeb0304aebdc46efa372e9d 100644
--- a/ui/surface/accelerated_surface_win.cc
+++ b/ui/surface/accelerated_surface_win.cc
@@ -36,6 +36,8 @@ typedef HRESULT (WINAPI *Direct3DCreate9ExFunc)(UINT sdk_version,
const wchar_t kD3D9ModuleName[] = L"d3d9.dll";
const char kCreate3D9DeviceExName[] = "Direct3DCreate9Ex";
+const char kGpuBlitDelay[] = "gpu-blit-delay";
+
struct Vertex {
float x, y, z, w;
float u, v;
@@ -657,6 +659,16 @@ static base::TimeDelta GetSwapDelay() {
return base::TimeDelta::FromMilliseconds(delay);
}
+static base::TimeDelta GetBlitDelay() {
+ CommandLine* cmd_line = CommandLine::ForCurrentProcess();
+ int delay = 0;
+ if (cmd_line->HasSwitch(kGpuBlitDelay)) {
+ base::StringToInt(cmd_line->GetSwitchValueNative(
+ kGpuBlitDelay).c_str(), &delay);
+ }
+ return base::TimeDelta::FromMilliseconds(delay);
+}
+
void AcceleratedPresenter::DoPresentAndAcknowledge(
const gfx::Size& size,
int64 surface_handle,
@@ -758,6 +770,10 @@ void AcceleratedPresenter::DoPresentAndAcknowledge(
size.width(), size.height()
};
+ static const base::TimeDelta blit_delay = GetBlitDelay();
+ if (blit_delay.ToInternalValue())
+ base::PlatformThread::Sleep(blit_delay);
+
{
TRACE_EVENT0("gpu", "Copy");
« 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