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

Side by Side Diff: ui/gfx/surface/accelerated_surface_win.cc

Issue 10222029: Fix framerate jank for accelerated content on windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gfx/surface/accelerated_surface_win.h" 5 #include "ui/gfx/surface/accelerated_surface_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <algorithm> 8 #include <algorithm>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 630
631 if (hr == S_FALSE) 631 if (hr == S_FALSE)
632 Sleep(1); 632 Sleep(1);
633 } while (hr == S_FALSE); 633 } while (hr == S_FALSE);
634 } 634 }
635 635
636 static const base::TimeDelta swap_delay = GetSwapDelay(); 636 static const base::TimeDelta swap_delay = GetSwapDelay();
637 if (swap_delay.ToInternalValue()) 637 if (swap_delay.ToInternalValue())
638 base::PlatformThread::Sleep(swap_delay); 638 base::PlatformThread::Sleep(swap_delay);
639 639
640 scoped_completion_runner.Release();
641 if (!completion_task.is_null())
642 completion_task.Run(true);
643
644 { 640 {
645 TRACE_EVENT0("surface", "Present"); 641 TRACE_EVENT0("surface", "Present");
646 hr = swap_chain_->Present(&rect, &rect, window_, NULL, 0); 642 hr = swap_chain_->Present(&rect, &rect, window_, NULL, 0);
647 if (FAILED(hr) && 643 if (FAILED(hr) &&
648 FAILED(present_thread_->device()->CheckDeviceState(window_))) { 644 FAILED(present_thread_->device()->CheckDeviceState(window_))) {
649 present_thread_->ResetDevice(); 645 present_thread_->ResetDevice();
650 } 646 }
651 } 647 }
652 } 648 }
653 649
(...skipping 21 matching lines...) Expand all
675 return presenter_->Present(); 671 return presenter_->Present();
676 } 672 }
677 673
678 bool AcceleratedSurface::CopyTo(const gfx::Size& size, void* buf) { 674 bool AcceleratedSurface::CopyTo(const gfx::Size& size, void* buf) {
679 return presenter_->CopyTo(size, buf); 675 return presenter_->CopyTo(size, buf);
680 } 676 }
681 677
682 void AcceleratedSurface::Suspend() { 678 void AcceleratedSurface::Suspend() {
683 presenter_->Suspend(); 679 presenter_->Suspend();
684 } 680 }
OLDNEW
« 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