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

Side by Side Diff: cc/output/output_surface_client.h

Issue 2151433004: cc: Make LayerTreeHostImpl::SwapBuffers not virtual. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@removedidswap
Patch Set: novirtualswapbuffers: num_draws_ Created 4 years, 5 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 | « cc/output/delegating_renderer_unittest.cc ('k') | cc/test/fake_output_surface.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 CC_OUTPUT_OUTPUT_SURFACE_CLIENT_H_ 5 #ifndef CC_OUTPUT_OUTPUT_SURFACE_CLIENT_H_
6 #define CC_OUTPUT_OUTPUT_SURFACE_CLIENT_H_ 6 #define CC_OUTPUT_OUTPUT_SURFACE_CLIENT_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 16 matching lines...) Expand all
27 public: 27 public:
28 // TODO(enne): Remove this in favor of using SetBeginFrameSource. 28 // TODO(enne): Remove this in favor of using SetBeginFrameSource.
29 virtual void CommitVSyncParameters(base::TimeTicks timebase, 29 virtual void CommitVSyncParameters(base::TimeTicks timebase,
30 base::TimeDelta interval) = 0; 30 base::TimeDelta interval) = 0;
31 // Pass the begin frame source for the client to observe. Client does not own 31 // Pass the begin frame source for the client to observe. Client does not own
32 // the BeginFrameSource. OutputSurface should call this once after binding to 32 // the BeginFrameSource. OutputSurface should call this once after binding to
33 // the client and then call again with a null while detaching. 33 // the client and then call again with a null while detaching.
34 virtual void SetBeginFrameSource(BeginFrameSource* source) = 0; 34 virtual void SetBeginFrameSource(BeginFrameSource* source) = 0;
35 35
36 virtual void SetNeedsRedrawRect(const gfx::Rect& damage_rect) = 0; 36 virtual void SetNeedsRedrawRect(const gfx::Rect& damage_rect) = 0;
37 // For LayerTreeHostImpl, this is more of a OnSwapBuffersAck from the display
38 // compositor that it received and will use the frame, unblocking it from
39 // producing more frames.
40 // For the display compositor this is literally a notification that the swap
41 // to the hardware is complete.
37 virtual void DidSwapBuffersComplete() = 0; 42 virtual void DidSwapBuffersComplete() = 0;
38 virtual void DidReceiveTextureInUseResponses( 43 virtual void DidReceiveTextureInUseResponses(
39 const gpu::TextureInUseResponses& responses) = 0; 44 const gpu::TextureInUseResponses& responses) = 0;
40 virtual void ReclaimResources(const CompositorFrameAck* ack) = 0; 45 virtual void ReclaimResources(const CompositorFrameAck* ack) = 0;
41 virtual void DidLoseOutputSurface() = 0; 46 virtual void DidLoseOutputSurface() = 0;
42 virtual void SetExternalTilePriorityConstraints( 47 virtual void SetExternalTilePriorityConstraints(
43 const gfx::Rect& viewport_rect, 48 const gfx::Rect& viewport_rect,
44 const gfx::Transform& transform) = 0; 49 const gfx::Transform& transform) = 0;
45 virtual void SetMemoryPolicy(const ManagedMemoryPolicy& policy) = 0; 50 virtual void SetMemoryPolicy(const ManagedMemoryPolicy& policy) = 0;
46 // If set, |callback| will be called subsequent to each new tree activation, 51 // If set, |callback| will be called subsequent to each new tree activation,
47 // regardless of the compositor visibility or damage. |callback| must remain 52 // regardless of the compositor visibility or damage. |callback| must remain
48 // valid for the lifetime of the OutputSurfaceClient or until unregisted -- 53 // valid for the lifetime of the OutputSurfaceClient or until unregisted --
49 // use SetTreeActivationCallback(base::Closure()) to unregister it. 54 // use SetTreeActivationCallback(base::Closure()) to unregister it.
50 virtual void SetTreeActivationCallback(const base::Closure& callback) = 0; 55 virtual void SetTreeActivationCallback(const base::Closure& callback) = 0;
51 // This allows the output surface to ask its client for a draw. 56 // This allows the output surface to ask its client for a draw.
52 virtual void OnDraw(const gfx::Transform& transform, 57 virtual void OnDraw(const gfx::Transform& transform,
53 const gfx::Rect& viewport, 58 const gfx::Rect& viewport,
54 const gfx::Rect& clip, 59 const gfx::Rect& clip,
55 bool resourceless_software_draw) = 0; 60 bool resourceless_software_draw) = 0;
56 61
57 protected: 62 protected:
58 virtual ~OutputSurfaceClient() {} 63 virtual ~OutputSurfaceClient() {}
59 }; 64 };
60 65
61 } // namespace cc 66 } // namespace cc
62 67
63 #endif // CC_OUTPUT_OUTPUT_SURFACE_CLIENT_H_ 68 #endif // CC_OUTPUT_OUTPUT_SURFACE_CLIENT_H_
OLDNEW
« no previous file with comments | « cc/output/delegating_renderer_unittest.cc ('k') | cc/test/fake_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698