OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_DRAW_DELEGATE_H_ | |
6 #define CONTENT_PUBLIC_BROWSER_ANDROID_DRAW_DELEGATE_H_ | |
7 | |
8 #include "base/callback.h" | |
9 #include "ui/gfx/native_widget_types.h" | |
10 | |
11 namespace content { | |
12 | |
13 class RenderWidgetHostView; | |
14 | |
15 // This interface facilitates the communication between compositor and | |
16 // UI with respect to new frames arriving and acknowledging when they | |
17 // have been presented. | |
18 class DrawDelegate { | |
jam
2012/07/27 20:46:29
this isn't really an interface. why is all this in
no sievers
2012/07/31 01:28:44
I split this into DrawDelegate and DrawDelegateImp
| |
19 public: | |
20 static DrawDelegate* GetInstance(); | |
21 DrawDelegate(); | |
22 ~DrawDelegate(); | |
23 | |
24 // Callback to be run after the frame has been drawn. It passes back | |
25 // a synchronization point identifier. | |
26 typedef base::Callback<void(uint32)> SurfacePresentedCallback; | |
27 | |
28 // Notification to the UI that the surface identified by the texture id | |
29 // has been updated. | |
30 typedef base::Callback<void( | |
31 uint64, | |
32 RenderWidgetHostView*, | |
33 const SurfacePresentedCallback&)> SurfaceUpdatedCallback; | |
34 | |
35 void SetUpdateCallback(const SurfaceUpdatedCallback& callback); | |
36 | |
37 void OnSurfaceUpdated(uint64 texture, RenderWidgetHostView* view, | |
38 const SurfacePresentedCallback& present_callback); | |
39 | |
40 // TODO(sievers): This should be private | |
41 // This surface handle is used by the compositor. There currently | |
42 // are some dependencies between compositor and UI context for | |
43 // TextureImageTransportSurface, and that's why it depends on the | |
44 // UI surface creation here. | |
45 void SetDrawSurface(gfx::GLSurfaceHandle handle) { handle_ = handle; } | |
46 gfx::GLSurfaceHandle GetDrawSurface() { return handle_; } | |
47 | |
48 protected: | |
49 SurfaceUpdatedCallback draw_callback_; | |
50 gfx::GLSurfaceHandle handle_; | |
51 }; | |
52 | |
53 }; // namespace content | |
Ted C
2012/07/27 20:31:15
no semi-colon
no sievers
2012/07/31 01:28:44
Done.
| |
54 | |
55 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_DRAW_DELEGATE_H_ | |
OLD | NEW |