Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / skia / src / gpu / GrGpu.h
index cd7502e..b752f7c 100644 (file)
@@ -13,9 +13,9 @@
 #include "SkPath.h"
 
 class GrContext;
-class GrGpuObject;
 class GrIndexBufferAllocPool;
 class GrPath;
+class GrPathRange;
 class GrPathRenderer;
 class GrPathRendererChain;
 class GrStencilBuffer;
@@ -138,6 +138,13 @@ public:
     GrPath* createPath(const SkPath& path, const SkStrokeRec& stroke);
 
     /**
+     * Creates a path range object that can be used to draw multiple paths via
+     * drawPaths(). It is only legal to call this if the caps report support for
+     * path rendering.
+     */
+    GrPathRange* createPathRange(size_t size, const SkStrokeRec&);
+
+    /**
      * Returns an index buffer that can be used to render quads.
      * Six indices per quad: 0, 1, 2, 0, 2, 3, etc.
      * The max number of quads can be queried using GrIndexBuffer::maxQuads().
@@ -242,28 +249,28 @@ public:
                             size_t rowBytes);
 
     /**
-     * Called to tell GrGpu that all GrGpuObjects have been lost and should
+     * Called to tell GrGpu that all GrGpuResources have been lost and should
      * be abandoned. Overrides must call INHERITED::abandonResources().
      */
     virtual void abandonResources();
 
     /**
-     * Called to tell GrGpu to release all GrGpuObjects. Overrides must call
+     * Called to tell GrGpu to release all GrGpuResources. Overrides must call
      * INHERITED::releaseResources().
      */
     void releaseResources();
 
     /**
-     * Add object to list of objects. Should only be called by GrGpuObject.
+     * Add object to list of objects. Should only be called by GrGpuResource.
      * @param resource  the resource to add.
      */
-    void insertObject(GrGpuObject* object);
+    void insertObject(GrGpuResource* object);
 
     /**
-     * Remove object from list of objects. Should only be called by GrGpuObject.
+     * Remove object from list of objects. Should only be called by GrGpuResource.
      * @param resource  the resource to remove.
      */
-    void removeObject(GrGpuObject* object);
+    void removeObject(GrGpuResource* object);
 
     // GrDrawTarget overrides
     virtual void clear(const SkIRect* rect,
@@ -432,6 +439,7 @@ private:
     virtual GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) = 0;
     virtual GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) = 0;
     virtual GrPath* onCreatePath(const SkPath& path, const SkStrokeRec&) = 0;
+    virtual GrPathRange* onCreatePathRange(size_t size, const SkStrokeRec&) = 0;
 
     // overridden by backend-specific derived class to perform the clear and
     // clearRect. NULL rect means clear whole target. If canIgnoreRect is
@@ -444,8 +452,10 @@ private:
     // overridden by backend-specific derived class to perform the path stenciling.
     virtual void onGpuStencilPath(const GrPath*, SkPath::FillType) = 0;
     virtual void onGpuDrawPath(const GrPath*, SkPath::FillType) = 0;
-    virtual void onGpuDrawPaths(int, const GrPath**, const SkMatrix*,
-                                SkPath::FillType, SkStrokeRec::Style) = 0;
+    virtual void onGpuDrawPaths(const GrPathRange*,
+                                const uint32_t indices[], int count,
+                                const float transforms[], PathTransformType,
+                                SkPath::FillType) = 0;
 
     // overridden by backend-specific derived class to perform the read pixels.
     virtual bool onReadPixels(GrRenderTarget* target,
@@ -488,9 +498,10 @@ private:
     virtual void onStencilPath(const GrPath*, SkPath::FillType) SK_OVERRIDE;
     virtual void onDrawPath(const GrPath*, SkPath::FillType,
                             const GrDeviceCoordTexture* dstCopy) SK_OVERRIDE;
-    virtual void onDrawPaths(int, const GrPath**, const SkMatrix*,
-                             SkPath::FillType, SkStrokeRec::Style,
-                             const GrDeviceCoordTexture* dstCopy) SK_OVERRIDE;
+    virtual void onDrawPaths(const GrPathRange*,
+                             const uint32_t indices[], int count,
+                             const float transforms[], PathTransformType,
+                             SkPath::FillType, const GrDeviceCoordTexture*) SK_OVERRIDE;
 
     // readies the pools to provide vertex/index data.
     void prepareVertexPool();
@@ -515,7 +526,7 @@ private:
     enum {
         kPreallocGeomPoolStateStackCnt = 4,
     };
-    typedef SkTInternalLList<GrGpuObject> ObjectList;
+    typedef SkTInternalLList<GrGpuResource> ObjectList;
     SkSTArray<kPreallocGeomPoolStateStackCnt, GeometryPoolState, true>  fGeomPoolStateStack;
     ResetTimestamp                                                      fResetTimestamp;
     uint32_t                                                            fResetBits;