OLD | NEW |
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 Loading... |
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 renderer_->SwapBuffers(frame->metadata); | 115 CompositorFrameMetadata metadata; |
| 116 renderer_->SwapBuffers(metadata); |
116 for (SurfaceAggregator::SurfaceIndexMap::iterator it = | 117 for (SurfaceAggregator::SurfaceIndexMap::iterator it = |
117 aggregator_->previous_contained_surfaces().begin(); | 118 aggregator_->previous_contained_surfaces().begin(); |
118 it != aggregator_->previous_contained_surfaces().end(); | 119 it != aggregator_->previous_contained_surfaces().end(); |
119 ++it) { | 120 ++it) { |
120 Surface* surface = manager_->GetSurfaceForId(it->first); | 121 Surface* surface = manager_->GetSurfaceForId(it->first); |
121 if (surface) | 122 if (surface) |
122 surface->RunDrawCallbacks(); | 123 surface->RunDrawCallbacks(); |
123 } | 124 } |
124 return true; | 125 return true; |
125 } | 126 } |
126 | 127 |
127 void Display::OnSurfaceDamaged(SurfaceId surface) { | 128 void Display::OnSurfaceDamaged(SurfaceId surface) { |
128 if (aggregator_ && aggregator_->previous_contained_surfaces().count(surface)) | 129 if (aggregator_ && aggregator_->previous_contained_surfaces().count(surface)) |
129 client_->DisplayDamaged(); | 130 client_->DisplayDamaged(); |
130 } | 131 } |
131 | 132 |
132 SurfaceId Display::CurrentSurfaceId() { | 133 SurfaceId Display::CurrentSurfaceId() { |
133 return current_surface_id_; | 134 return current_surface_id_; |
134 } | 135 } |
135 | 136 |
136 } // namespace cc | 137 } // namespace cc |
OLD | NEW |