Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Side by Side Diff: content/common/render_widget_surface_properties.cc

Issue 2882303002: Factor FrameData out of RendererCompositorFrameSink (Closed)
Patch Set: Remove duplicate line in build file Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698