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 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 |
OLD | NEW |