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

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

Issue 511423004: Add LatencyInfo support for 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
« no previous file with comments | « cc/cc.gyp ('k') | 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 gfx::Rect device_viewport_rect = gfx::Rect(current_surface_size_); 105 gfx::Rect device_viewport_rect = gfx::Rect(current_surface_size_);
106 gfx::Rect device_clip_rect = device_viewport_rect; 106 gfx::Rect device_clip_rect = device_viewport_rect;
107 bool disable_picture_quad_image_filtering = false; 107 bool disable_picture_quad_image_filtering = false;
108 108
109 renderer_->DecideRenderPassAllocationsForFrame(frame_data->render_pass_list); 109 renderer_->DecideRenderPassAllocationsForFrame(frame_data->render_pass_list);
110 renderer_->DrawFrame(&frame_data->render_pass_list, 110 renderer_->DrawFrame(&frame_data->render_pass_list,
111 device_scale_factor, 111 device_scale_factor,
112 device_viewport_rect, 112 device_viewport_rect,
113 device_clip_rect, 113 device_clip_rect,
114 disable_picture_quad_image_filtering); 114 disable_picture_quad_image_filtering);
115 CompositorFrameMetadata metadata; 115 renderer_->SwapBuffers(frame->metadata);
116 renderer_->SwapBuffers(metadata);
117 for (SurfaceAggregator::SurfaceIndexMap::iterator it = 116 for (SurfaceAggregator::SurfaceIndexMap::iterator it =
118 aggregator_->previous_contained_surfaces().begin(); 117 aggregator_->previous_contained_surfaces().begin();
119 it != aggregator_->previous_contained_surfaces().end(); 118 it != aggregator_->previous_contained_surfaces().end();
120 ++it) { 119 ++it) {
121 Surface* surface = manager_->GetSurfaceForId(it->first); 120 Surface* surface = manager_->GetSurfaceForId(it->first);
122 if (surface) 121 if (surface)
123 surface->RunDrawCallbacks(); 122 surface->RunDrawCallbacks();
124 } 123 }
125 return true; 124 return true;
126 } 125 }
127 126
128 void Display::OnSurfaceDamaged(SurfaceId surface) { 127 void Display::OnSurfaceDamaged(SurfaceId surface) {
129 if (aggregator_ && aggregator_->previous_contained_surfaces().count(surface)) 128 if (aggregator_ && aggregator_->previous_contained_surfaces().count(surface))
130 client_->DisplayDamaged(); 129 client_->DisplayDamaged();
131 } 130 }
132 131
133 SurfaceId Display::CurrentSurfaceId() { 132 SurfaceId Display::CurrentSurfaceId() {
134 return current_surface_id_; 133 return current_surface_id_;
135 } 134 }
136 135
137 } // namespace cc 136 } // namespace cc
OLDNEW
« no previous file with comments | « cc/cc.gyp ('k') | cc/surfaces/surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698