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

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

Issue 1821863002: Hook up ui::Compositor to Display's BeginFrameSource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase; refactor mus output surface Created 4 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
« no previous file with comments | « no previous file | cc/surfaces/display.h » ('j') | cc/surfaces/display.h » ('J')
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"
11 #include "cc/base/cc_export.h" 11 #include "cc/base/cc_export.h"
12 #include "cc/output/context_provider.h" 12 #include "cc/output/context_provider.h"
13 #include "ui/gfx/geometry/rect.h" 13 #include "ui/gfx/geometry/rect.h"
14 14
15 namespace gfx { 15 namespace gfx {
16 class Transform; 16 class Transform;
17 } 17 }
18 18
19 namespace cc { 19 namespace cc {
20 20
21 class BeginFrameSource;
21 class CompositorFrameAck; 22 class CompositorFrameAck;
22 struct ManagedMemoryPolicy; 23 struct ManagedMemoryPolicy;
23 24
24 class CC_EXPORT OutputSurfaceClient { 25 class CC_EXPORT OutputSurfaceClient {
25 public: 26 public:
27 // TODO(enne): Remove this in favor of using SetBeginFrameSource.
26 virtual void CommitVSyncParameters(base::TimeTicks timebase, 28 virtual void CommitVSyncParameters(base::TimeTicks timebase,
sunnyps 2016/04/01 22:35:25 nit: This only calls CommitVSyncParameters on the
enne (OOO) 2016/04/02 00:18:38 I think you're going to need to be more specific w
sunnyps 2016/04/02 00:47:15 Sorry for the confusion, I thought I was looking a
enne (OOO) 2016/04/04 18:12:32 Oh! Good thought. Done. :)
27 base::TimeDelta interval) = 0; 29 base::TimeDelta interval) = 0;
30 // Pass the begin frame source for the client to observe. Client does not own
31 // the BeginFrameSource. OutputSurface should call this once after binding to
32 // the client and then call again with a null while detaching.
33 virtual void SetBeginFrameSource(BeginFrameSource* source) = 0;
34
28 virtual void SetNeedsRedrawRect(const gfx::Rect& damage_rect) = 0; 35 virtual void SetNeedsRedrawRect(const gfx::Rect& damage_rect) = 0;
29 virtual void DidSwapBuffers() = 0; 36 virtual void DidSwapBuffers() = 0;
30 virtual void DidSwapBuffersComplete() = 0; 37 virtual void DidSwapBuffersComplete() = 0;
31 virtual void ReclaimResources(const CompositorFrameAck* ack) = 0; 38 virtual void ReclaimResources(const CompositorFrameAck* ack) = 0;
32 virtual void DidLoseOutputSurface() = 0; 39 virtual void DidLoseOutputSurface() = 0;
33 virtual void SetExternalTilePriorityConstraints( 40 virtual void SetExternalTilePriorityConstraints(
34 const gfx::Rect& viewport_rect, 41 const gfx::Rect& viewport_rect,
35 const gfx::Transform& transform) = 0; 42 const gfx::Transform& transform) = 0;
36 virtual void SetMemoryPolicy(const ManagedMemoryPolicy& policy) = 0; 43 virtual void SetMemoryPolicy(const ManagedMemoryPolicy& policy) = 0;
37 // If set, |callback| will be called subsequent to each new tree activation, 44 // If set, |callback| will be called subsequent to each new tree activation,
38 // regardless of the compositor visibility or damage. |callback| must remain 45 // regardless of the compositor visibility or damage. |callback| must remain
39 // valid for the lifetime of the OutputSurfaceClient or until unregisted -- 46 // valid for the lifetime of the OutputSurfaceClient or until unregisted --
40 // use SetTreeActivationCallback(base::Closure()) to unregister it. 47 // use SetTreeActivationCallback(base::Closure()) to unregister it.
41 virtual void SetTreeActivationCallback(const base::Closure& callback) = 0; 48 virtual void SetTreeActivationCallback(const base::Closure& callback) = 0;
42 // This allows the output surface to ask it's client for a draw. 49 // This allows the output surface to ask its client for a draw.
43 virtual void OnDraw(const gfx::Transform& transform, 50 virtual void OnDraw(const gfx::Transform& transform,
44 const gfx::Rect& viewport, 51 const gfx::Rect& viewport,
45 const gfx::Rect& clip, 52 const gfx::Rect& clip,
46 bool resourceless_software_draw) = 0; 53 bool resourceless_software_draw) = 0;
47 54
48 protected: 55 protected:
49 virtual ~OutputSurfaceClient() {} 56 virtual ~OutputSurfaceClient() {}
50 }; 57 };
51 58
52 } // namespace cc 59 } // namespace cc
53 60
54 #endif // CC_OUTPUT_OUTPUT_SURFACE_CLIENT_H_ 61 #endif // CC_OUTPUT_OUTPUT_SURFACE_CLIENT_H_
OLDNEW
« no previous file with comments | « no previous file | cc/surfaces/display.h » ('j') | cc/surfaces/display.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698