| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ui/android/delegated_frame_host_android.h" | 5 #include "ui/android/delegated_frame_host_android.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "cc/layers/solid_color_layer.h" | 9 #include "cc/layers/solid_color_layer.h" |
| 10 #include "cc/layers/surface_layer.h" | 10 #include "cc/layers/surface_layer.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 background_layer_->RemoveFromParent(); | 101 background_layer_->RemoveFromParent(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 DelegatedFrameHostAndroid::FrameData::FrameData() = default; | 104 DelegatedFrameHostAndroid::FrameData::FrameData() = default; |
| 105 | 105 |
| 106 DelegatedFrameHostAndroid::FrameData::~FrameData() = default; | 106 DelegatedFrameHostAndroid::FrameData::~FrameData() = default; |
| 107 | 107 |
| 108 void DelegatedFrameHostAndroid::SubmitCompositorFrame( | 108 void DelegatedFrameHostAndroid::SubmitCompositorFrame( |
| 109 cc::CompositorFrame frame, | 109 cc::CompositorFrame frame, |
| 110 cc::SurfaceFactory::DrawCallback draw_callback) { | 110 cc::SurfaceFactory::DrawCallback draw_callback) { |
| 111 cc::RenderPass* root_pass = frame.render_pass_list.back().get(); | 111 cc::RenderPass* root_pass = |
| 112 frame.delegated_frame_data->render_pass_list.back().get(); |
| 112 gfx::Size surface_size = root_pass->output_rect.size(); | 113 gfx::Size surface_size = root_pass->output_rect.size(); |
| 113 | 114 |
| 114 if (!current_frame_ || surface_size != current_frame_->surface_size || | 115 if (!current_frame_ || surface_size != current_frame_->surface_size || |
| 115 current_frame_->top_controls_height != | 116 current_frame_->top_controls_height != |
| 116 frame.metadata.top_controls_height || | 117 frame.metadata.top_controls_height || |
| 117 current_frame_->top_controls_shown_ratio != | 118 current_frame_->top_controls_shown_ratio != |
| 118 frame.metadata.top_controls_shown_ratio || | 119 frame.metadata.top_controls_shown_ratio || |
| 119 current_frame_->bottom_controls_height != | 120 current_frame_->bottom_controls_height != |
| 120 frame.metadata.bottom_controls_height || | 121 frame.metadata.bottom_controls_height || |
| 121 current_frame_->bottom_controls_shown_ratio != | 122 current_frame_->bottom_controls_shown_ratio != |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 content_size_in_dip.width() < container_size_in_dip_.width() || | 264 content_size_in_dip.width() < container_size_in_dip_.width() || |
| 264 content_size_in_dip.height() < container_size_in_dip_.height(); | 265 content_size_in_dip.height() < container_size_in_dip_.height(); |
| 265 } else { | 266 } else { |
| 266 background_is_drawable = true; | 267 background_is_drawable = true; |
| 267 } | 268 } |
| 268 | 269 |
| 269 background_layer_->SetIsDrawable(background_is_drawable); | 270 background_layer_->SetIsDrawable(background_is_drawable); |
| 270 } | 271 } |
| 271 | 272 |
| 272 } // namespace ui | 273 } // namespace ui |
| OLD | NEW |