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

Unified Diff: ui/compositor/compositor.h

Issue 1513053002: WIP - Gutterless resize on Windows Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback Created 5 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 side-by-side diff with in-line comments
Download patch
Index: ui/compositor/compositor.h
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
index 1602d30caae8b7b4ad72f727422e309428722004..eacf804a77161b09810b2dd3783d009aa598e192 100644
--- a/ui/compositor/compositor.h
+++ b/ui/compositor/compositor.h
@@ -324,9 +324,12 @@ class COMPOSITOR_EXPORT Compositor
return surface_id_allocator_.get();
}
+ gfx::Size last_swapped_frame_size() const { return last_swapped_frame_size_; }
+
private:
friend class base::RefCounted<Compositor>;
friend class CompositorLock;
+ class ResizeSwapPromise;
// Called by CompositorLock.
void UnlockCompositor();
@@ -334,6 +337,16 @@ class COMPOSITOR_EXPORT Compositor
// Called to release any pending CompositorLock
void CancelCompositorLock();
+ void set_pending_swapped_frame_size(
+ const gfx::Size& pending_swapped_frame_size) {
+ pending_swapped_frame_size_ = pending_swapped_frame_size;
+ }
+
+ void UpdateLastSwappedFrameSize() {
+ last_swapped_frame_size_ = pending_swapped_frame_size_;
+ pending_swapped_frame_size_ = gfx::Size();
+ }
+
gfx::Size size_;
ui::ContextFactory* context_factory_;
@@ -372,6 +385,14 @@ class COMPOSITOR_EXPORT Compositor
// Used to send to any new CompositorBeginFrameObserver immediately.
cc::BeginFrameArgs missed_begin_frame_args_;
+ // Used to track the last swapped frame size. We use a swap promise to track
+ // the progression of a frame through resizing of the compositor to posting
+ // swap buffers. Once posted, the frame's size is recorded to
+ // |pending_swapped_frame_size_|. Once a swap completes, the pending size is
+ // promoted to the |last_swapped_frame_size_|.
+ gfx::Size last_swapped_frame_size_;
+ gfx::Size pending_swapped_frame_size_;
+
base::WeakPtrFactory<Compositor> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(Compositor);

Powered by Google App Engine
This is Rietveld 408576698