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

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

Issue 568763004: Support distributing vsync info with surfaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 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/surface_display_output_surface.h" 5 #include "content/browser/compositor/surface_display_output_surface.h"
6 6
7 #include "cc/output/compositor_frame.h" 7 #include "cc/output/compositor_frame.h"
8 #include "cc/output/compositor_frame_ack.h" 8 #include "cc/output/compositor_frame_ack.h"
9 #include "cc/surfaces/display.h" 9 #include "cc/surfaces/display.h"
10 #include "cc/surfaces/surface.h" 10 #include "cc/surfaces/surface.h"
(...skipping 15 matching lines...) Expand all
26 capabilities_.max_frames_pending = 1; 26 capabilities_.max_frames_pending = 1;
27 } 27 }
28 28
29 SurfaceDisplayOutputSurface::~SurfaceDisplayOutputSurface() { 29 SurfaceDisplayOutputSurface::~SurfaceDisplayOutputSurface() {
30 client_ = NULL; 30 client_ = NULL;
31 if (!surface_id_.is_null()) { 31 if (!surface_id_.is_null()) {
32 factory_.Destroy(surface_id_); 32 factory_.Destroy(surface_id_);
33 } 33 }
34 } 34 }
35 35
36 void SurfaceDisplayOutputSurface::ReceivedVSyncParameters(
37 base::TimeTicks timebase,
38 base::TimeDelta interval) {
39 CommitVSyncParameters(timebase, interval);
40 }
41
36 void SurfaceDisplayOutputSurface::SwapBuffers(cc::CompositorFrame* frame) { 42 void SurfaceDisplayOutputSurface::SwapBuffers(cc::CompositorFrame* frame) {
37 gfx::Size frame_size = 43 gfx::Size frame_size =
38 frame->delegated_frame_data->render_pass_list.back()->output_rect.size(); 44 frame->delegated_frame_data->render_pass_list.back()->output_rect.size();
39 if (frame_size != display_size_) { 45 if (frame_size != display_size_) {
40 if (!surface_id_.is_null()) { 46 if (!surface_id_.is_null()) {
41 factory_.Destroy(surface_id_); 47 factory_.Destroy(surface_id_);
42 } 48 }
43 surface_id_ = allocator_.GenerateId(); 49 surface_id_ = allocator_.GenerateId();
44 factory_.Create(surface_id_, frame_size); 50 factory_.Create(surface_id_, frame_size);
45 display_size_ = frame_size; 51 display_size_ = frame_size;
(...skipping 17 matching lines...) Expand all
63 ack.resources = resources; 69 ack.resources = resources;
64 if (client_) 70 if (client_)
65 client_->ReclaimResources(&ack); 71 client_->ReclaimResources(&ack);
66 } 72 }
67 73
68 void SurfaceDisplayOutputSurface::SwapBuffersComplete() { 74 void SurfaceDisplayOutputSurface::SwapBuffersComplete() {
69 client_->DidSwapBuffersComplete(); 75 client_->DidSwapBuffersComplete();
70 } 76 }
71 77
72 } // namespace content 78 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/compositor/surface_display_output_surface.h ('k') | mojo/services/surfaces/surfaces_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698