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

Side by Side Diff: ui/aura/mus/surface_id_handler.h

Issue 2610723002: Unify SurfaceInfo (Closed)
Patch Set: Cleanup offscreen canvas Created 3 years, 11 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 | « ui/aura/mus/DEPS ('k') | ui/aura/mus/window_mus.h » ('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 #ifndef UI_AURA_MUS_SURFACE_ID_HANDLER_H_ 5 #ifndef UI_AURA_MUS_SURFACE_ID_HANDLER_H_
6 #define UI_AURA_MUS_SURFACE_ID_HANDLER_H_ 6 #define UI_AURA_MUS_SURFACE_ID_HANDLER_H_
7 7
8 #include "cc/surfaces/surface_id.h" 8 #include "cc/surfaces/surface_id.h"
9 #include "ui/gfx/geometry/size.h" 9 #include "ui/gfx/geometry/size.h"
10 10
11 namespace cc {
12 class SurfaceInfo;
13 }
14
11 namespace aura { 15 namespace aura {
12 16
13 class Window; 17 class Window;
14 18
15 // Holds information about the current surface held by a Window.
16 // |surface_id| uniquely identifies the surface in the display
17 // compositor.
18 // |frame_size| is the size of the frame held by the surface.
19 // |device_scale_factor| is the scale factor that the frame was
20 // renderered for.
21 struct SurfaceInfo {
22 cc::SurfaceId surface_id;
23 gfx::Size frame_size;
24 float device_scale_factor;
25 };
26
27 class SurfaceIdHandler { 19 class SurfaceIdHandler {
28 public: 20 public:
29 // Called when a child window allocates a new surface ID. 21 // Called when a child window allocates a new surface ID.
30 // If the handler wishes to retain ownership of the |surface_info|, 22 // If the handler wishes to retain ownership of the |surface_info|,
31 // it can move it. If a child's surface has been cleared then 23 // it can move it. If a child's surface has been cleared then
32 // |surface_info| will refer to a null pointer. 24 // |surface_info| will refer to a null pointer.
33 virtual void OnChildWindowSurfaceChanged( 25 virtual void OnChildWindowSurfaceChanged(
34 Window* window, 26 Window* window,
35 std::unique_ptr<SurfaceInfo>* surface_info) = 0; 27 const cc::SurfaceInfo& surface_info) = 0;
36 }; 28 };
37 29
38 } // namespace aura 30 } // namespace aura
39 31
40 #endif // UI_AURA_MUS_SURFACE_ID_HANDLER_H_ 32 #endif // UI_AURA_MUS_SURFACE_ID_HANDLER_H_
OLDNEW
« no previous file with comments | « ui/aura/mus/DEPS ('k') | ui/aura/mus/window_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698