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

Side by Side Diff: content/browser/compositor/browser_compositor_output_surface.cc

Issue 629293004: Call DidPostSwapBuffers and SwapBuffersComplete for browser software surface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 6 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/browser/compositor/browser_compositor_output_surface.h" 5 #include "content/browser/compositor/browser_compositor_output_surface.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "content/browser/compositor/reflector_impl.h" 10 #include "content/browser/compositor/reflector_impl.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 if (!OutputSurface::BindToClient(client)) 61 if (!OutputSurface::BindToClient(client))
62 return false; 62 return false;
63 63
64 output_surface_map_->AddWithID(this, surface_id_); 64 output_surface_map_->AddWithID(this, surface_id_);
65 if (reflector_.get()) 65 if (reflector_.get())
66 reflector_->OnSourceSurfaceReady(this); 66 reflector_->OnSourceSurfaceReady(this);
67 vsync_manager_->AddObserver(this); 67 vsync_manager_->AddObserver(this);
68 return true; 68 return true;
69 } 69 }
70 70
71 void BrowserCompositorOutputSurface::OnSwapBuffersComplete() {
72 // On Mac, delay acknowledging the swap to the output surface client until
73 // it has been drawn.
74 #if !defined(OS_MACOSX)
75 cc::OutputSurface::OnSwapBuffersComplete();
76 #endif
77 }
78
79 void BrowserCompositorOutputSurface::OnUpdateVSyncParameters( 71 void BrowserCompositorOutputSurface::OnUpdateVSyncParameters(
80 base::TimeTicks timebase, 72 base::TimeTicks timebase,
81 base::TimeDelta interval) { 73 base::TimeDelta interval) {
82 DCHECK(CalledOnValidThread()); 74 DCHECK(CalledOnValidThread());
83 DCHECK(HasClient()); 75 DCHECK(HasClient());
84 CommitVSyncParameters(timebase, interval); 76 CommitVSyncParameters(timebase, interval);
85 } 77 }
86 78
87 void BrowserCompositorOutputSurface::OnUpdateVSyncParametersFromGpu( 79 void BrowserCompositorOutputSurface::OnUpdateVSyncParametersFromGpu(
88 base::TimeTicks timebase, 80 base::TimeTicks timebase,
89 base::TimeDelta interval) { 81 base::TimeDelta interval) {
90 DCHECK(CalledOnValidThread()); 82 DCHECK(CalledOnValidThread());
91 DCHECK(HasClient()); 83 DCHECK(HasClient());
92 vsync_manager_->UpdateVSyncParameters(timebase, interval); 84 vsync_manager_->UpdateVSyncParameters(timebase, interval);
93 } 85 }
94 86
95 void BrowserCompositorOutputSurface::SetReflector(ReflectorImpl* reflector) { 87 void BrowserCompositorOutputSurface::SetReflector(ReflectorImpl* reflector) {
96 reflector_ = reflector; 88 reflector_ = reflector;
97 } 89 }
98 90
99 #if defined(OS_MACOSX)
100 void BrowserCompositorOutputSurface::OnSurfaceDisplayed() {
101 cc::OutputSurface::OnSwapBuffersComplete();
102 }
103 #endif
104
105 } // namespace content 91 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698