Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / content / public / browser / android / synchronous_compositor.h
index 1d03278..4db367f 100644 (file)
 
 class SkCanvas;
 
+namespace cc {
+class CompositorFrame;
+class CompositorFrameAck;
+}
+
 namespace gfx {
-class GLSurface;
 class Transform;
 };
 
-namespace content {
+namespace gpu {
+class GLInProcessContext;
+}
 
-class WebContents;
+namespace content {
 
 class SynchronousCompositorClient;
+class WebContents;
 
 struct CONTENT_EXPORT SynchronousCompositorMemoryPolicy {
   // Memory limit for rendering and pre-rendering.
@@ -56,12 +63,17 @@ class CONTENT_EXPORT SynchronousCompositor {
   static void SetGpuService(
       scoped_refptr<gpu::InProcessCommandBuffer::Service> service);
 
+  // By default, synchronous compopsitor records the full layer, not only
+  // what is inside and around the view port. This can be used to switch
+  // between this record-full-layer behavior and normal record-around-viewport
+  // behavior.
+  static void SetRecordFullDocument(bool record_full_document);
+
   // Synchronously initialize compositor for hardware draw. Can only be called
   // while compositor is in software only mode, either after compositor is
   // first created or after ReleaseHwDraw is called. It is invalid to
-  // DemandDrawHw before this returns true. |surface| is the GLSurface that
-  // should be used to create the underlying hardware context.
-  virtual bool InitializeHwDraw(scoped_refptr<gfx::GLSurface> surface) = 0;
+  // DemandDrawHw before this returns true.
+  virtual bool InitializeHwDraw() = 0;
 
   // Reverse of InitializeHwDraw above. Can only be called while hardware draw
   // is already initialized. Brings compositor back to software only mode and
@@ -69,14 +81,18 @@ class CONTENT_EXPORT SynchronousCompositor {
   virtual void ReleaseHwDraw() = 0;
 
   // "On demand" hardware draw. The content is first clipped to |damage_area|,
-  // then transformed through |transform|, and finally clipped to |view_size|
-  // and by the existing stencil buffer if any.
-  virtual bool DemandDrawHw(
+  // then transformed through |transform|, and finally clipped to |view_size|.
+  virtual scoped_ptr<cc::CompositorFrame> DemandDrawHw(
       gfx::Size surface_size,
       const gfx::Transform& transform,
       gfx::Rect viewport,
       gfx::Rect clip,
-      bool stencil_enabled) = 0;
+      gfx::Rect viewport_rect_for_tile_priority,
+      const gfx::Transform& transform_for_tile_priority) = 0;
+
+  // For delegated rendering, return resources from parent compositor to this.
+  // Note that all resources must be returned before ReleaseHwDraw.
+  virtual void ReturnResources(const cc::CompositorFrameAck& frame_ack) = 0;
 
   // "On demand" SW draw, into the supplied canvas (observing the transform
   // and clip set there-in).