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

Side by Side Diff: cc/output/output_surface.cc

Issue 23767011: cc: Always use SetNeedsBeginFrame to request the next BeginFrame (Closed) Base URL: http://git.chromium.org/chromium/src.git@pollForDrawTriggers
Patch Set: Created 7 years, 3 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "cc/output/output_surface.h" 5 #include "cc/output/output_surface.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 base::TimeTicks alternative_deadline = 185 base::TimeTicks alternative_deadline =
186 skipped_begin_frame_args_.frame_time + 186 skipped_begin_frame_args_.frame_time +
187 AlternateRetroactiveBeginFramePeriod(); 187 AlternateRetroactiveBeginFramePeriod();
188 if (now < skipped_begin_frame_args_.deadline || 188 if (now < skipped_begin_frame_args_.deadline ||
189 now < alternative_deadline) { 189 now < alternative_deadline) {
190 BeginFrame(skipped_begin_frame_args_); 190 BeginFrame(skipped_begin_frame_args_);
191 } 191 }
192 } 192 }
193 193
194 void OutputSurface::DidSwapBuffers() { 194 void OutputSurface::DidSwapBuffers() {
195 begin_frame_pending_ = false;
196 pending_swap_buffers_++; 195 pending_swap_buffers_++;
197 TRACE_EVENT1("cc", "OutputSurface::DidSwapBuffers", 196 TRACE_EVENT1("cc", "OutputSurface::DidSwapBuffers",
198 "pending_swap_buffers_", pending_swap_buffers_); 197 "pending_swap_buffers_", pending_swap_buffers_);
199 if (frame_rate_controller_) 198 if (frame_rate_controller_)
200 frame_rate_controller_->DidSwapBuffers(); 199 frame_rate_controller_->DidSwapBuffers();
201 PostCheckForRetroactiveBeginFrame(); 200 PostCheckForRetroactiveBeginFrame();
202 } 201 }
203 202
204 void OutputSurface::OnSwapBuffersComplete(const CompositorFrameAck* ack) { 203 void OutputSurface::OnSwapBuffersComplete(const CompositorFrameAck* ack) {
205 pending_swap_buffers_--; 204 pending_swap_buffers_--;
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 "discard_backbuffer", discard_backbuffer); 398 "discard_backbuffer", discard_backbuffer);
400 // Just ignore the memory manager when it says to set the limit to zero 399 // Just ignore the memory manager when it says to set the limit to zero
401 // bytes. This will happen when the memory manager thinks that the renderer 400 // bytes. This will happen when the memory manager thinks that the renderer
402 // is not visible (which the renderer knows better). 401 // is not visible (which the renderer knows better).
403 if (policy.bytes_limit_when_visible) 402 if (policy.bytes_limit_when_visible)
404 client_->SetMemoryPolicy(policy); 403 client_->SetMemoryPolicy(policy);
405 client_->SetDiscardBackBufferWhenNotVisible(discard_backbuffer); 404 client_->SetDiscardBackBufferWhenNotVisible(discard_backbuffer);
406 } 405 }
407 406
408 } // namespace cc 407 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/output/output_surface_unittest.cc » ('j') | cc/output/output_surface_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698