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

Unified Diff: ui/surface/accelerated_surface_win.cc

Issue 11782018: Revert 174920 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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
« no previous file with comments | « ui/surface/accelerated_surface_win.h ('k') | 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
===================================================================
--- ui/surface/accelerated_surface_win.cc (revision 175378)
+++ ui/surface/accelerated_surface_win.cc (working copy)
@@ -269,13 +269,11 @@
void AcceleratedPresenter::AsyncPresentAndAcknowledge(
const gfx::Size& size,
int64 surface_handle,
- const CopyCompletionTask& copy_completion_task,
- const PresentCompletionTask& present_completion_task) {
+ const CompletionTask& completion_task) {
if (!surface_handle) {
TRACE_EVENT1("gpu", "EarlyOut_ZeroSurfaceHandle",
"surface_handle", surface_handle);
- copy_completion_task.Run(true);
- present_completion_task.Run(base::TimeTicks(), base::TimeDelta());
+ completion_task.Run(true, base::TimeTicks(), base::TimeDelta());
return;
}
@@ -285,8 +283,7 @@
this,
size,
surface_handle,
- copy_completion_task,
- present_completion_task));
+ completion_task));
}
void AcceleratedPresenter::Present(HDC dc) {
@@ -472,8 +469,7 @@
void AcceleratedPresenter::DoPresentAndAcknowledge(
const gfx::Size& size,
int64 surface_handle,
- const CopyCompletionTask& copy_completion_task,
- const PresentCompletionTask& present_completion_task) {
+ const CompletionTask& completion_task) {
TRACE_EVENT2(
"gpu", "DoPresentAndAcknowledge",
"width", size.width(),
@@ -487,21 +483,15 @@
present_thread_->InitDevice();
if (!present_thread_->device()) {
- if (!copy_completion_task.is_null())
- copy_completion_task.Run(false);
- if (!present_completion_task.is_null())
- present_completion_task.Run(base::TimeTicks(), base::TimeDelta());
+ if (!completion_task.is_null())
+ completion_task.Run(false, base::TimeTicks(), base::TimeDelta());
TRACE_EVENT0("gpu", "EarlyOut_NoDevice");
return;
}
// Ensure the task is always run and while the lock is taken.
- base::ScopedClosureRunner scoped_copy_completion_runner(
- base::Bind(copy_completion_task, true));
- base::ScopedClosureRunner scoped_present_completion_runner(
- base::Bind(present_completion_task,
- base::TimeTicks(),
- base::TimeDelta()));
+ base::ScopedClosureRunner scoped_completion_runner(
+ base::Bind(completion_task, true, base::TimeTicks(), base::TimeDelta()));
// If invalidated, do nothing, the window is gone.
if (!window_) {
@@ -604,23 +594,6 @@
if (FAILED(hr))
return;
- // Wait for the StretchRect to complete before notifying the GPU process
- // that it is safe to write to its backing store again.
- {
- TRACE_EVENT0("gpu", "spin");
- do {
- hr = present_thread_->query()->GetData(NULL, 0, D3DGETDATA_FLUSH);
-
- if (hr == S_FALSE)
- Sleep(1);
- } while (hr == S_FALSE);
- }
-
- // Acknowledge that the copy is complete and it is safe to modify the shared
- // texture.
- scoped_copy_completion_runner.Release();
- copy_completion_task.Run(true);
-
present_size_ = size;
static const base::TimeDelta swap_delay = GetSwapDelay();
@@ -686,8 +659,20 @@
1000000 / display_mode.RefreshRate);
}
- scoped_present_completion_runner.Release();
- present_completion_task.Run(last_vsync_time, refresh_period);
+ // Wait for the StretchRect to complete before notifying the GPU process
+ // that it is safe to write to its backing store again.
+ {
+ TRACE_EVENT0("gpu", "spin");
+ do {
+ hr = present_thread_->query()->GetData(NULL, 0, D3DGETDATA_FLUSH);
+
+ if (hr == S_FALSE)
+ Sleep(1);
+ } while (hr == S_FALSE);
+ }
+
+ scoped_completion_runner.Release();
+ completion_task.Run(true, last_vsync_time, refresh_period);
}
void AcceleratedPresenter::DoSuspend() {
« no previous file with comments | « ui/surface/accelerated_surface_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698