OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/common/render_widget_surface_properties.h" |
| 6 |
| 7 namespace content { |
| 8 |
| 9 // static |
| 10 RenderWidgetSurfaceProperties |
| 11 RenderWidgetSurfaceProperties::FromCompositorFrame( |
| 12 const cc::CompositorFrame& frame) { |
| 13 RenderWidgetSurfaceProperties properties; |
| 14 properties.frame_size = frame.render_pass_list.back()->output_rect.size(); |
| 15 properties.device_scale_factor = frame.metadata.device_scale_factor; |
| 16 #ifdef OS_ANDROID |
| 17 properties.top_controls_height = frame.metadata.top_controls_height; |
| 18 properties.top_controls_shown_ratio = frame.metadata.top_controls_shown_ratio; |
| 19 properties.bottom_controls_height = frame.metadata.bottom_controls_height; |
| 20 properties.bottom_controls_shown_ratio = |
| 21 frame.metadata.bottom_controls_shown_ratio; |
| 22 properties.selection = frame.metadata.selection; |
| 23 properties.has_transparent_background = root_pass->has_transparent_background; |
| 24 #endif |
| 25 return properties; |
| 26 } |
| 27 |
| 28 bool RenderWidgetSurfaceProperties::operator==( |
| 29 const RenderWidgetSurfaceProperties& other) const { |
| 30 return other.device_scale_factor == device_scale_factor && |
| 31 #ifdef OS_ANDROID |
| 32 other.top_controls_height == top_controls_height && |
| 33 other.top_controls_shown_ratio == top_controls_shown_ratio && |
| 34 other.bottom_controls_height == bottom_controls_height && |
| 35 other.bottom_controls_shown_ratio == bottom_controls_shown_ratio && |
| 36 other.selection == selection && |
| 37 other.has_transparent_background == has_transparent_background && |
| 38 #endif |
| 39 other.frame_size == frame_size; |
| 40 } |
| 41 |
| 42 bool RenderWidgetSurfaceProperties::operator!=( |
| 43 const RenderWidgetSurfaceProperties& other) const { |
| 44 return !(*this == other); |
| 45 } |
| 46 |
| 47 } // namespace content |
OLD | NEW |