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

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

Issue 2882303002: Factor FrameData out of RendererCompositorFrameSink (Closed)
Patch Set: c 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.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 =
24 frame.render_pass_list.back()->has_transparent_background;
25 #endif
26 return properties;
27 }
28
29 RenderWidgetSurfaceProperties::RenderWidgetSurfaceProperties() = default;
30
31 RenderWidgetSurfaceProperties::RenderWidgetSurfaceProperties(
32 const RenderWidgetSurfaceProperties& other) = default;
33
34 RenderWidgetSurfaceProperties::~RenderWidgetSurfaceProperties() = default;
35
36 RenderWidgetSurfaceProperties& RenderWidgetSurfaceProperties::operator=(
37 const RenderWidgetSurfaceProperties& other) = default;
38
39 bool RenderWidgetSurfaceProperties::operator==(
40 const RenderWidgetSurfaceProperties& other) const {
41 return other.device_scale_factor == device_scale_factor &&
42 #ifdef OS_ANDROID
43 other.top_controls_height == top_controls_height &&
44 other.top_controls_shown_ratio == top_controls_shown_ratio &&
45 other.bottom_controls_height == bottom_controls_height &&
46 other.bottom_controls_shown_ratio == bottom_controls_shown_ratio &&
47 other.selection == selection &&
48 other.has_transparent_background == has_transparent_background &&
49 #endif
50 other.size == size;
51 }
52
53 bool RenderWidgetSurfaceProperties::operator!=(
54 const RenderWidgetSurfaceProperties& other) const {
55 return !(*this == other);
56 }
57
58 } // namespace content
OLDNEW
« no previous file with comments | « content/common/render_widget_surface_properties.h ('k') | content/renderer/gpu/renderer_compositor_frame_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698