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

Side by Side Diff: ui/compositor/compositor.h

Issue 767443002: Ensure Surface size always matches window size on swap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_COMPOSITOR_COMPOSITOR_H_ 5 #ifndef UI_COMPOSITOR_COMPOSITOR_H_
6 #define UI_COMPOSITOR_COMPOSITOR_H_ 6 #define UI_COMPOSITOR_COMPOSITOR_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 // Gets the GPU memory buffer manager. 99 // Gets the GPU memory buffer manager.
100 virtual gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() = 0; 100 virtual gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() = 0;
101 101
102 // Gets the compositor message loop, or NULL if not using threaded 102 // Gets the compositor message loop, or NULL if not using threaded
103 // compositing. 103 // compositing.
104 virtual base::MessageLoopProxy* GetCompositorMessageLoop() = 0; 104 virtual base::MessageLoopProxy* GetCompositorMessageLoop() = 0;
105 105
106 // Creates a Surface ID allocator with a new namespace. 106 // Creates a Surface ID allocator with a new namespace.
107 virtual scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() = 0; 107 virtual scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() = 0;
108
109 // Resize the display corresponding to this compositor to a particular size.
110 virtual void ResizeDisplay(ui::Compositor* compositor,
111 const gfx::Size& size) = 0;
108 }; 112 };
109 113
110 // This class represents a lock on the compositor, that can be used to prevent 114 // This class represents a lock on the compositor, that can be used to prevent
111 // commits to the compositor tree while we're waiting for an asynchronous 115 // commits to the compositor tree while we're waiting for an asynchronous
112 // event. The typical use case is when waiting for a renderer to produce a frame 116 // event. The typical use case is when waiting for a renderer to produce a frame
113 // at the right size. The caller keeps a reference on this object, and drops the 117 // at the right size. The caller keeps a reference on this object, and drops the
114 // reference once it desires to release the lock. 118 // reference once it desires to release the lock.
115 // Note however that the lock is cancelled after a short timeout to ensure 119 // Note however that the lock is cancelled after a short timeout to ensure
116 // responsiveness of the UI, so the compositor tree should be kept in a 120 // responsiveness of the UI, so the compositor tree should be kept in a
117 // "reasonable" state while the lock is held. 121 // "reasonable" state while the lock is held.
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 180
177 // Where possible, draws are scissored to a damage region calculated from 181 // Where possible, draws are scissored to a damage region calculated from
178 // changes to layer properties. This bypasses that and indicates that 182 // changes to layer properties. This bypasses that and indicates that
179 // the whole frame needs to be drawn. 183 // the whole frame needs to be drawn.
180 void ScheduleFullRedraw(); 184 void ScheduleFullRedraw();
181 185
182 // Schedule redraw and append damage_rect to the damage region calculated 186 // Schedule redraw and append damage_rect to the damage region calculated
183 // from changes to layer properties. 187 // from changes to layer properties.
184 void ScheduleRedrawRect(const gfx::Rect& damage_rect); 188 void ScheduleRedrawRect(const gfx::Rect& damage_rect);
185 189
186 // Finishes all outstanding rendering on the GPU. 190 // Finishes all outstanding rendering and disables swapping on this surface
187 void FinishAllRendering(); 191 // until it is resized.
192 void DisableSwapUntilResize();
188 193
189 void SetLatencyInfo(const LatencyInfo& latency_info); 194 void SetLatencyInfo(const LatencyInfo& latency_info);
190 195
191 // Sets the compositor's device scale factor and size. 196 // Sets the compositor's device scale factor and size.
192 void SetScaleAndSize(float scale, const gfx::Size& size_in_pixel); 197 void SetScaleAndSize(float scale, const gfx::Size& size_in_pixel);
193 198
194 // Returns the size of the widget that is being drawn to in pixel coordinates. 199 // Returns the size of the widget that is being drawn to in pixel coordinates.
195 const gfx::Size& size() const { return size_; } 200 const gfx::Size& size() const { return size_; }
196 201
197 // Sets the background color used for areas that aren't covered by 202 // Sets the background color used for areas that aren't covered by
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 LayerAnimatorCollection layer_animator_collection_; 342 LayerAnimatorCollection layer_animator_collection_;
338 343
339 base::WeakPtrFactory<Compositor> weak_ptr_factory_; 344 base::WeakPtrFactory<Compositor> weak_ptr_factory_;
340 345
341 DISALLOW_COPY_AND_ASSIGN(Compositor); 346 DISALLOW_COPY_AND_ASSIGN(Compositor);
342 }; 347 };
343 348
344 } // namespace ui 349 } // namespace ui
345 350
346 #endif // UI_COMPOSITOR_COMPOSITOR_H_ 351 #endif // UI_COMPOSITOR_COMPOSITOR_H_
OLDNEW
« no previous file with comments | « content/browser/compositor/surface_display_output_surface.cc ('k') | ui/compositor/compositor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698