| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 95 |
| 96 // Only reshape when we know we are going to draw. Otherwise, the reshape | 96 // Only reshape when we know we are going to draw. Otherwise, the reshape |
| 97 // can leave the window at the wrong size if we never draw and the proper | 97 // can leave the window at the wrong size if we never draw and the proper |
| 98 // viewport size is never set. | 98 // viewport size is never set. |
| 99 output_surface_->Reshape(current_surface_size_, 1.f); | 99 output_surface_->Reshape(current_surface_size_, 1.f); |
| 100 float device_scale_factor = 1.0f; | 100 float device_scale_factor = 1.0f; |
| 101 gfx::Rect device_viewport_rect = gfx::Rect(current_surface_size_); | 101 gfx::Rect device_viewport_rect = gfx::Rect(current_surface_size_); |
| 102 gfx::Rect device_clip_rect = device_viewport_rect; | 102 gfx::Rect device_clip_rect = device_viewport_rect; |
| 103 bool disable_picture_quad_image_filtering = false; | 103 bool disable_picture_quad_image_filtering = false; |
| 104 | 104 |
| 105 renderer_->DecideRenderPassAllocationsForFrame(frame_data->render_pass_list); |
| 105 renderer_->DrawFrame(&frame_data->render_pass_list, | 106 renderer_->DrawFrame(&frame_data->render_pass_list, |
| 106 device_scale_factor, | 107 device_scale_factor, |
| 107 device_viewport_rect, | 108 device_viewport_rect, |
| 108 device_clip_rect, | 109 device_clip_rect, |
| 109 disable_picture_quad_image_filtering); | 110 disable_picture_quad_image_filtering); |
| 110 CompositorFrameMetadata metadata; | 111 CompositorFrameMetadata metadata; |
| 111 renderer_->SwapBuffers(metadata); | 112 renderer_->SwapBuffers(metadata); |
| 112 return true; | 113 return true; |
| 113 } | 114 } |
| 114 | 115 |
| 115 SurfaceId Display::CurrentSurfaceId() { | 116 SurfaceId Display::CurrentSurfaceId() { |
| 116 return current_surface_id_; | 117 return current_surface_id_; |
| 117 } | 118 } |
| 118 | 119 |
| 119 } // namespace cc | 120 } // namespace cc |
| OLD | NEW |