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

Side by Side Diff: cc/surfaces/display.cc

Issue 465673003: Add callback when queueing frame on Surface to create backpressure. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | « no previous file | cc/surfaces/surface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "cc/surfaces/display.h" 5 #include "cc/surfaces/display.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "cc/output/compositor_frame.h" 9 #include "cc/output/compositor_frame.h"
10 #include "cc/output/compositor_frame_ack.h" 10 #include "cc/output/compositor_frame_ack.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 bool disable_picture_quad_image_filtering = false; 109 bool disable_picture_quad_image_filtering = false;
110 110
111 renderer_->DecideRenderPassAllocationsForFrame(frame_data->render_pass_list); 111 renderer_->DecideRenderPassAllocationsForFrame(frame_data->render_pass_list);
112 renderer_->DrawFrame(&frame_data->render_pass_list, 112 renderer_->DrawFrame(&frame_data->render_pass_list,
113 device_scale_factor, 113 device_scale_factor,
114 device_viewport_rect, 114 device_viewport_rect,
115 device_clip_rect, 115 device_clip_rect,
116 disable_picture_quad_image_filtering); 116 disable_picture_quad_image_filtering);
117 CompositorFrameMetadata metadata; 117 CompositorFrameMetadata metadata;
118 renderer_->SwapBuffers(metadata); 118 renderer_->SwapBuffers(metadata);
119 for (std::set<SurfaceId>::iterator it = contained_surfaces_.begin();
120 it != contained_surfaces_.end();
121 ++it) {
122 Surface* surface = manager_->GetSurfaceForId(*it);
123 if (surface)
124 surface->RunDrawCallbacks();
125 }
119 return true; 126 return true;
120 } 127 }
121 128
122 void Display::OnSurfaceDamaged(SurfaceId surface) { 129 void Display::OnSurfaceDamaged(SurfaceId surface) {
123 if (contained_surfaces_.find(surface) != contained_surfaces_.end()) 130 if (contained_surfaces_.find(surface) != contained_surfaces_.end())
124 client_->DisplayDamaged(); 131 client_->DisplayDamaged();
125 } 132 }
126 133
127 SurfaceId Display::CurrentSurfaceId() { 134 SurfaceId Display::CurrentSurfaceId() {
128 return current_surface_id_; 135 return current_surface_id_;
129 } 136 }
130 137
131 } // namespace cc 138 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/surfaces/surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698