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

Side by Side Diff: content/browser/compositor/gpu_browser_compositor_output_surface.h

Issue 1097223002: Mac: Fix black flashing during tab switch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Wait for swap to draw frames Created 5 years, 8 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ 5 #ifndef CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
6 #define CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ 6 #define CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
7 7
8 #include "base/cancelable_callback.h" 8 #include "base/cancelable_callback.h"
9 #include "content/browser/compositor/browser_compositor_output_surface.h" 9 #include "content/browser/compositor/browser_compositor_output_surface.h"
10 10
(...skipping 19 matching lines...) Expand all
30 30
31 ~GpuBrowserCompositorOutputSurface() override; 31 ~GpuBrowserCompositorOutputSurface() override;
32 32
33 protected: 33 protected:
34 // cc::OutputSurface implementation. 34 // cc::OutputSurface implementation.
35 void SwapBuffers(cc::CompositorFrame* frame) override; 35 void SwapBuffers(cc::CompositorFrame* frame) override;
36 bool BindToClient(cc::OutputSurfaceClient* client) override; 36 bool BindToClient(cc::OutputSurfaceClient* client) override;
37 37
38 #if defined(OS_MACOSX) 38 #if defined(OS_MACOSX)
39 void OnSurfaceDisplayed() override; 39 void OnSurfaceDisplayed() override;
40 void OnSurfaceRecycled() override; 40 void SetSurfaceSuspendedForRecycle(bool suspended) override;
41 bool ShouldNotShowFramesAfterRecycle() const override; 41 bool SurfaceShouldNotShowFramesAfterSuspendForRecycle() const override;
42 bool should_not_show_frames_; 42 enum ShouldShowFramesState {
43 // Frames that come from the GPU process should appear on-screen.
44 SHOULD_SHOW_FRAMES,
45 // The compositor has been suspended. Any frames that come from the GPU
46 // process are for the pre-suspend content and should not be displayed.
47 SHOULD_NOT_SHOW_FRAMES_SUSPENDED,
48 // The compositor has been un-suspended, but has not yet issued a swap
49 // since being un-suspended, so any frames that come from the GPU process
50 // are for pre-suspend content and should not be displayed.
51 SHOULD_NOT_SHOW_FRAMES_NO_SWAP_AFTER_SUSPENDED,
52 };
53 ShouldShowFramesState should_show_frames_state_;
43 #endif 54 #endif
44 55
45 CommandBufferProxyImpl* GetCommandBufferProxy(); 56 CommandBufferProxyImpl* GetCommandBufferProxy();
46 void OnSwapBuffersCompleted(const std::vector<ui::LatencyInfo>& latency_info); 57 void OnSwapBuffersCompleted(const std::vector<ui::LatencyInfo>& latency_info);
47 58
48 base::CancelableCallback<void(const std::vector<ui::LatencyInfo>&)> 59 base::CancelableCallback<void(const std::vector<ui::LatencyInfo>&)>
49 swap_buffers_completion_callback_; 60 swap_buffers_completion_callback_;
50 base::CancelableCallback<void(base::TimeTicks timebase, 61 base::CancelableCallback<void(base::TimeTicks timebase,
51 base::TimeDelta interval)> 62 base::TimeDelta interval)>
52 update_vsync_parameters_callback_; 63 update_vsync_parameters_callback_;
53 64
54 DISALLOW_COPY_AND_ASSIGN(GpuBrowserCompositorOutputSurface); 65 DISALLOW_COPY_AND_ASSIGN(GpuBrowserCompositorOutputSurface);
55 }; 66 };
56 67
57 } // namespace content 68 } // namespace content
58 69
59 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ 70 #endif // CONTENT_BROWSER_COMPOSITOR_GPU_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698