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

Side by Side Diff: services/ui/ws/frame_generator.cc

Issue 2547243002: Set device scale factor in CompositorFrame and scale frame size in WS. (Closed)
Patch Set: test Created 4 years 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
« no previous file with comments | « services/ui/ws/frame_generator.h ('k') | services/ui/ws/frame_generator_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "services/ui/ws/frame_generator.h" 5 #include "services/ui/ws/frame_generator.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/containers/adapters.h" 9 #include "base/containers/adapters.h"
10 #include "cc/output/compositor_frame.h" 10 #include "cc/output/compositor_frame.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 output_rect, false, 1.f, SkBlendMode::kSrcOver, 0); 142 output_rect, false, 1.f, SkBlendMode::kSrcOver, 0);
143 auto* quad = invert_pass->CreateAndAppendDrawQuad<cc::RenderPassDrawQuad>(); 143 auto* quad = invert_pass->CreateAndAppendDrawQuad<cc::RenderPassDrawQuad>();
144 render_pass->filters.Append(cc::FilterOperation::CreateInvertFilter(1.f)); 144 render_pass->filters.Append(cc::FilterOperation::CreateInvertFilter(1.f));
145 quad->SetNew(shared_state, output_rect, output_rect, render_pass_id, 145 quad->SetNew(shared_state, output_rect, output_rect, render_pass_id,
146 0 /* mask_resource_id */, gfx::Vector2dF() /* mask_uv_scale */, 146 0 /* mask_resource_id */, gfx::Vector2dF() /* mask_uv_scale */,
147 gfx::Size() /* mask_texture_size */, 147 gfx::Size() /* mask_texture_size */,
148 gfx::Vector2dF() /* filters_scale */, 148 gfx::Vector2dF() /* filters_scale */,
149 gfx::PointF() /* filters_origin */); 149 gfx::PointF() /* filters_origin */);
150 frame.render_pass_list.push_back(std::move(invert_pass)); 150 frame.render_pass_list.push_back(std::move(invert_pass));
151 } 151 }
152 frame.metadata.device_scale_factor = device_scale_factor_;
152 153
153 return frame; 154 return frame;
154 } 155 }
155 156
156 void FrameGenerator::DrawWindowTree( 157 void FrameGenerator::DrawWindowTree(
157 cc::RenderPass* pass, 158 cc::RenderPass* pass,
158 ServerWindow* window, 159 ServerWindow* window,
159 const gfx::Vector2d& parent_to_root_origin_offset, 160 const gfx::Vector2d& parent_to_root_origin_offset,
160 float opacity) { 161 float opacity) {
161 if (!window->visible()) 162 if (!window->visible())
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 cc::SurfaceId underlay_surface_id = 341 cc::SurfaceId underlay_surface_id =
341 window->compositor_frame_sink_manager()->GetLatestSurfaceId( 342 window->compositor_frame_sink_manager()->GetLatestSurfaceId(
342 mojom::CompositorFrameSinkType::UNDERLAY); 343 mojom::CompositorFrameSinkType::UNDERLAY);
343 if (underlay_surface_id.is_valid()) 344 if (underlay_surface_id.is_valid())
344 RemoveFrameSinkReference(underlay_surface_id.frame_sink_id()); 345 RemoveFrameSinkReference(underlay_surface_id.frame_sink_id());
345 } 346 }
346 347
347 } // namespace ws 348 } // namespace ws
348 349
349 } // namespace ui 350 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/frame_generator.h ('k') | services/ui/ws/frame_generator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698