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

Side by Side Diff: components/exo/surface.h

Issue 2843723003: Make exo::Surface set device_scale_factor. (Closed)
Patch Set: Get device_scale_factor from aura::Window. 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
« no previous file with comments | « no previous file | components/exo/surface.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef COMPONENTS_EXO_SURFACE_H_ 5 #ifndef COMPONENTS_EXO_SURFACE_H_
6 #define COMPONENTS_EXO_SURFACE_H_ 6 #define COMPONENTS_EXO_SURFACE_H_
7 7
8 #include <list> 8 #include <list>
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 // This sets the only visible on secure output flag, preventing it from 133 // This sets the only visible on secure output flag, preventing it from
134 // appearing in screenshots or from being viewed on non-secure displays. 134 // appearing in screenshots or from being viewed on non-secure displays.
135 void SetOnlyVisibleOnSecureOutput(bool only_visible_on_secure_output); 135 void SetOnlyVisibleOnSecureOutput(bool only_visible_on_secure_output);
136 136
137 // This sets the blend mode that will be used when drawing the surface. 137 // This sets the blend mode that will be used when drawing the surface.
138 void SetBlendMode(SkBlendMode blend_mode); 138 void SetBlendMode(SkBlendMode blend_mode);
139 139
140 // This sets the alpha value that will be applied to the whole surface. 140 // This sets the alpha value that will be applied to the whole surface.
141 void SetAlpha(float alpha); 141 void SetAlpha(float alpha);
142 142
143 // This sets the device scale factor sent in CompositorFrames.
144 void SetDeviceScaleFactor(float device_scale_factor);
145
143 // Surface state (damage regions, attached buffers, etc.) is double-buffered. 146 // Surface state (damage regions, attached buffers, etc.) is double-buffered.
144 // A Commit() call atomically applies all pending state, replacing the 147 // A Commit() call atomically applies all pending state, replacing the
145 // current state. Commit() is not guaranteed to be synchronous. See 148 // current state. Commit() is not guaranteed to be synchronous. See
146 // CommitSurfaceHierarchy() below. 149 // CommitSurfaceHierarchy() below.
147 void Commit(); 150 void Commit();
148 151
149 // This will synchronously commit all pending state of the surface and its 152 // This will synchronously commit all pending state of the surface and its
150 // descendants by recursively calling CommitSurfaceHierarchy() for each 153 // descendants by recursively calling CommitSurfaceHierarchy() for each
151 // sub-surface with pending state. 154 // sub-surface with pending state.
152 void CommitSurfaceHierarchy(); 155 void CommitSurfaceHierarchy();
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 // This is the size of the last committed contents. 310 // This is the size of the last committed contents.
308 gfx::Size content_size_; 311 gfx::Size content_size_;
309 312
310 // This is true when Attach() has been called and new contents should take 313 // This is true when Attach() has been called and new contents should take
311 // effect next time Commit() is called. 314 // effect next time Commit() is called.
312 bool has_pending_contents_ = false; 315 bool has_pending_contents_ = false;
313 316
314 // The buffer that will become the content of surface when Commit() is called. 317 // The buffer that will become the content of surface when Commit() is called.
315 BufferAttachment pending_buffer_; 318 BufferAttachment pending_buffer_;
316 319
320 // The device scale factor sent in CompositorFrames.
321 float device_scale_factor_ = 1.0f;
reveman 2017/04/27 21:01:30 Did you verify that this is updated as the |windio
kylechar 2017/04/28 18:02:16 It gets updated when the ui::Layer with |window_|
reveman 2017/04/28 18:06:49 Sounds good. UpdateSurface calls before delegate i
322
317 const cc::FrameSinkId frame_sink_id_; 323 const cc::FrameSinkId frame_sink_id_;
318 cc::LocalSurfaceId local_surface_id_; 324 cc::LocalSurfaceId local_surface_id_;
319 325
320 scoped_refptr<CompositorFrameSinkHolder> compositor_frame_sink_holder_; 326 scoped_refptr<CompositorFrameSinkHolder> compositor_frame_sink_holder_;
321 327
322 cc::LocalSurfaceIdAllocator id_allocator_; 328 cc::LocalSurfaceIdAllocator id_allocator_;
323 329
324 // The next resource id the buffer will be attached to. 330 // The next resource id the buffer will be attached to.
325 int next_resource_id_ = 1; 331 int next_resource_id_ = 1;
326 332
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 cc::BeginFrameSource* begin_frame_source_ = nullptr; 405 cc::BeginFrameSource* begin_frame_source_ = nullptr;
400 bool needs_begin_frame_ = false; 406 bool needs_begin_frame_ = false;
401 cc::BeginFrameAck current_begin_frame_ack_; 407 cc::BeginFrameAck current_begin_frame_ack_;
402 408
403 DISALLOW_COPY_AND_ASSIGN(Surface); 409 DISALLOW_COPY_AND_ASSIGN(Surface);
404 }; 410 };
405 411
406 } // namespace exo 412 } // namespace exo
407 413
408 #endif // COMPONENTS_EXO_SURFACE_H_ 414 #endif // COMPONENTS_EXO_SURFACE_H_
OLDNEW
« no previous file with comments | « no previous file | components/exo/surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698