| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_PUBLIC_BROWSER_ANDROID_DRAW_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_DRAW_DELEGATE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_DRAW_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_ANDROID_DRAW_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "ui/gfx/native_widget_types.h" | 9 #include "ui/gfx/native_widget_types.h" |
| 10 #include "ui/gfx/size.h" | 10 #include "ui/gfx/size.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 | 13 |
| 14 class RenderWidgetHostView; | 14 class RenderWidgetHostView; |
| 15 | 15 |
| 16 // This interface facilitates the communication between compositor and | 16 // TODO(sievers): Route sizing of views through ContentViewCore |
| 17 // UI with respect to new frames arriving and acknowledging when they | 17 // and remove this class. |
| 18 // have been presented. | |
| 19 class DrawDelegate { | 18 class DrawDelegate { |
| 20 public: | 19 public: |
| 21 static DrawDelegate* GetInstance(); | 20 static DrawDelegate* GetInstance(); |
| 22 virtual ~DrawDelegate() { } | 21 virtual ~DrawDelegate() { } |
| 23 | 22 |
| 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 virtual void SetUpdateCallback(const SurfaceUpdatedCallback& callback) = 0; | |
| 36 virtual void SetBounds(const gfx::Size& size) = 0; | 23 virtual void SetBounds(const gfx::Size& size) = 0; |
| 37 }; | 24 }; |
| 38 | 25 |
| 39 } // namespace content | 26 } // namespace content |
| 40 | 27 |
| 41 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_DRAW_DELEGATE_H_ | 28 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_DRAW_DELEGATE_H_ |
| OLD | NEW |