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

Unified Diff: content/public/browser/android/synchronous_compositor.h

Issue 2347563003: Added FrameFuture class (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/public/browser/android/synchronous_compositor.h
diff --git a/content/public/browser/android/synchronous_compositor.h b/content/public/browser/android/synchronous_compositor.h
index 4231a2d08caf8643ce188d93c4744e9d93e33634..4d0b40b6e686ee0d85c847b02043cc24ade6bc47 100644
--- a/content/public/browser/android/synchronous_compositor.h
+++ b/content/public/browser/android/synchronous_compositor.h
@@ -10,6 +10,7 @@
#include <memory>
#include "base/memory/ref_counted.h"
+#include "base/synchronization/waitable_event.h"
#include "base/time/time.h"
#include "cc/resources/returned_resource.h"
#include "content/common/content_export.h"
@@ -33,6 +34,7 @@ namespace content {
class SynchronousCompositorClient;
class WebContents;
+class FrameFuture;
boliu 2016/09/16 16:26:12 remove, this class does not actually exist
ojars 2016/09/19 22:02:37 Done.
// Interface for embedders that wish to direct compositing operations
// synchronously under their own control. Only meaningful when the
@@ -59,11 +61,26 @@ class CONTENT_EXPORT SynchronousCompositor {
DISALLOW_COPY_AND_ASSIGN(Frame);
};
+ class FrameFuture : public base::RefCountedThreadSafe<FrameFuture> {
+ public:
+ FrameFuture();
+ void setFrame(std::unique_ptr<SynchronousCompositor::Frame> frame);
+ SynchronousCompositor::Frame* getFrame();
+ bool hasFrame();
+
+ private:
+ base::WaitableEvent waitable_event_;
+ std::unique_ptr<content::SynchronousCompositor::Frame> frame_;
+ friend class base::RefCountedThreadSafe<FrameFuture>;
+ ~FrameFuture();
+ };
+
// "On demand" hardware draw. Parameters are used by compositor for this draw.
// |viewport_size| is the current size to improve results during resize.
// |viewport_rect_for_tile_priority| and |transform_for_tile_priority| are
// used to customize the tiling decisions of compositor.
- virtual Frame DemandDrawHw(
+ // TODO(ojars): update this and the next documentation
+ virtual scoped_refptr<FrameFuture> DemandDrawHw(
const gfx::Size& viewport_size,
const gfx::Rect& viewport_rect_for_tile_priority,
const gfx::Transform& transform_for_tile_priority) = 0;
@@ -71,7 +88,7 @@ class CONTENT_EXPORT SynchronousCompositor {
// Same as DemandDrawHw, but uses asynchronous IPC messages. Calls
// SynchronousCompositorClient::OnDrawHardwareProcessFrame to return the
// frame.
- virtual void DemandDrawHwAsync(
+ virtual scoped_refptr<FrameFuture> DemandDrawHwAsync(
const gfx::Size& viewport_size,
const gfx::Rect& viewport_rect_for_tile_priority,
const gfx::Transform& transform_for_tile_priority) = 0;

Powered by Google App Engine
This is Rietveld 408576698