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

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

Issue 10830347: Hook up Mac OSX VSync parameters to compositor thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | « content/browser/renderer_host/render_widget_host_view_mac.mm ('k') | 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/surface/accelerated_surface_win.h" 5 #include "ui/surface/accelerated_surface_win.h"
6 6
7 #include <dwmapi.h> 7 #include <dwmapi.h>
8 #include <windows.h> 8 #include <windows.h>
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 } 850 }
851 851
852 { 852 {
853 TRACE_EVENT0("gpu", "GetPresentationStats"); 853 TRACE_EVENT0("gpu", "GetPresentationStats");
854 base::TimeTicks timebase; 854 base::TimeTicks timebase;
855 base::TimeDelta interval; 855 base::TimeDelta interval;
856 uint32 numerator = 0, denominator = 0; 856 uint32 numerator = 0, denominator = 0;
857 if (GetPresentationStats(&timebase, &numerator, &denominator) && 857 if (GetPresentationStats(&timebase, &numerator, &denominator) &&
858 numerator > 0 && denominator > 0) { 858 numerator > 0 && denominator > 0) {
859 int64 interval_micros = 859 int64 interval_micros =
860 static_cast<int64>(1000000 * numerator) / denominator; 860 1000000 * static_cast<int64>(numerator) / denominator;
861 interval = base::TimeDelta::FromMicroseconds(interval_micros); 861 interval = base::TimeDelta::FromMicroseconds(interval_micros);
862 } 862 }
863 scoped_completion_runner.Release(); 863 scoped_completion_runner.Release();
864 completion_task.Run(true, timebase, interval); 864 completion_task.Run(true, timebase, interval);
865 TRACE_EVENT2("gpu", "GetPresentationStats", 865 TRACE_EVENT2("gpu", "GetPresentationStats",
866 "timebase", timebase.ToInternalValue(), 866 "timebase", timebase.ToInternalValue(),
867 "interval", interval.ToInternalValue()); 867 "interval", interval.ToInternalValue());
868 } 868 }
869 869
870 hidden_ = false; 870 hidden_ = false;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 return presenter_->CopyTo(src_subrect, dst_size, buf); 923 return presenter_->CopyTo(src_subrect, dst_size, buf);
924 } 924 }
925 925
926 void AcceleratedSurface::Suspend() { 926 void AcceleratedSurface::Suspend() {
927 presenter_->Suspend(); 927 presenter_->Suspend();
928 } 928 }
929 929
930 void AcceleratedSurface::WasHidden() { 930 void AcceleratedSurface::WasHidden() {
931 presenter_->WasHidden(); 931 presenter_->WasHidden();
932 } 932 }
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698