| 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);
|
|
|