| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  * Copyright 2010 Google Inc. | 2  * Copyright 2010 Google Inc. | 
| 3  * | 3  * | 
| 4  * Use of this source code is governed by a BSD-style license that can be | 4  * Use of this source code is governed by a BSD-style license that can be | 
| 5  * found in the LICENSE file. | 5  * found in the LICENSE file. | 
| 6  */ | 6  */ | 
| 7 | 7 | 
| 8 #ifndef GrDrawTarget_DEFINED | 8 #ifndef GrDrawTarget_DEFINED | 
| 9 #define GrDrawTarget_DEFINED | 9 #define GrDrawTarget_DEFINED | 
| 10 | 10 | 
| (...skipping 17 matching lines...) Expand all  Loading... | 
| 28 | 28 | 
| 29 class GrClipData; | 29 class GrClipData; | 
| 30 class GrDrawTargetCaps; | 30 class GrDrawTargetCaps; | 
| 31 class GrPath; | 31 class GrPath; | 
| 32 class GrPathRange; | 32 class GrPathRange; | 
| 33 | 33 | 
| 34 class GrDrawTarget : public SkRefCnt { | 34 class GrDrawTarget : public SkRefCnt { | 
| 35 public: | 35 public: | 
| 36     SK_DECLARE_INST_COUNT(GrDrawTarget) | 36     SK_DECLARE_INST_COUNT(GrDrawTarget) | 
| 37 | 37 | 
| 38     typedef GrPathRendering::PathTransformType PathTransformType ; | 38     typedef GrPathRange::PathIndexType PathIndexType; | 
|  | 39     typedef GrPathRendering::PathTransformType PathTransformType; | 
| 39 | 40 | 
| 40     /////////////////////////////////////////////////////////////////////////// | 41     /////////////////////////////////////////////////////////////////////////// | 
| 41 | 42 | 
| 42     // The context may not be fully constructed and should not be used during Gr
     DrawTarget | 43     // The context may not be fully constructed and should not be used during Gr
     DrawTarget | 
| 43     // construction. | 44     // construction. | 
| 44     GrDrawTarget(GrContext* context); | 45     GrDrawTarget(GrContext* context); | 
| 45     virtual ~GrDrawTarget(); | 46     virtual ~GrDrawTarget(); | 
| 46 | 47 | 
| 47     /** | 48     /** | 
| 48      * Gets the capabilities of the draw target. | 49      * Gets the capabilities of the draw target. | 
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 272      */ | 273      */ | 
| 273     void stencilPath(GrDrawState*, const GrPath*, GrPathRendering::FillType fill
     ); | 274     void stencilPath(GrDrawState*, const GrPath*, GrPathRendering::FillType fill
     ); | 
| 274 | 275 | 
| 275     /** | 276     /** | 
| 276      * Draws a path. Fill must not be a hairline. It will respect the HW | 277      * Draws a path. Fill must not be a hairline. It will respect the HW | 
| 277      * antialias flag on the draw state (if possible in the 3D API). | 278      * antialias flag on the draw state (if possible in the 3D API). | 
| 278      */ | 279      */ | 
| 279     void drawPath(GrDrawState*, const GrPath*, GrPathRendering::FillType fill); | 280     void drawPath(GrDrawState*, const GrPath*, GrPathRendering::FillType fill); | 
| 280 | 281 | 
| 281     /** | 282     /** | 
| 282      * Draws many paths. It will respect the HW | 283      * Draws the aggregate path from combining multiple. Note that this will not | 
| 283      * antialias flag on the draw state (if possible in the 3D API). | 284      * always be equivalent to back-to-back calls to drawPath(). It will respect | 
|  | 285      * the HW antialias flag on the draw state (if possible in the 3D API). | 
| 284      * | 286      * | 
| 285      * @param pathRange       Source of paths to draw from | 287      * @param pathRange       Source paths to draw from | 
| 286      * @param indices         Array of indices into the the pathRange | 288      * @param indices         Array of path indices to draw | 
| 287      * @param count           Number of paths to draw (length of indices array) | 289      * @param indexType       Data type of the array elements in indexBuffer | 
| 288      * @param transforms      Array of individual transforms, one for each path | 290      * @param transformValues Array of transforms for the individual paths | 
| 289      * @param transformsType  Type of transformations in the array. Array contai
     ns | 291      * @param transformType   Type of transforms in transformBuffer | 
| 290                               PathTransformSize(transformsType) * count elements | 292      * @param count           Number of paths to draw | 
| 291      * @param fill            Fill type for drawing all the paths | 293      * @param fill            Fill type for drawing all the paths | 
| 292      */ | 294      */ | 
| 293     void drawPaths(GrDrawState*, const GrPathRange* pathRange, | 295     void drawPaths(GrDrawState*, const GrPathRange* pathRange, | 
| 294                    const uint32_t indices[], | 296                    const void* indices, | 
|  | 297                    PathIndexType indexType, | 
|  | 298                    const float transformValues[], | 
|  | 299                    PathTransformType transformType, | 
| 295                    int count, | 300                    int count, | 
| 296                    const float transforms[], |  | 
| 297                    PathTransformType transformsType, |  | 
| 298                    GrPathRendering::FillType fill); | 301                    GrPathRendering::FillType fill); | 
| 299 | 302 | 
| 300     /** | 303     /** | 
| 301      * Helper function for drawing rects. It performs a geometry src push and po
     p | 304      * Helper function for drawing rects. It performs a geometry src push and po
     p | 
| 302      * and thus will finalize any reserved geometry. | 305      * and thus will finalize any reserved geometry. | 
| 303      * | 306      * | 
| 304      * @param rect        the rect to draw | 307      * @param rect        the rect to draw | 
| 305      * @param localRect   optional rect that specifies local coords to map onto | 308      * @param localRect   optional rect that specifies local coords to map onto | 
| 306      *                    rect. If NULL then rect serves as the local coords. | 309      *                    rect. If NULL then rect serves as the local coords. | 
| 307      * @param localMatrix optional matrix applied to localRect. If | 310      * @param localMatrix optional matrix applied to localRect. If | 
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 697                                const GrPath*, | 700                                const GrPath*, | 
| 698                                const GrClipMaskManager::ScissorState&, | 701                                const GrClipMaskManager::ScissorState&, | 
| 699                                const GrStencilSettings&) = 0; | 702                                const GrStencilSettings&) = 0; | 
| 700     virtual void onDrawPath(const GrDrawState&, | 703     virtual void onDrawPath(const GrDrawState&, | 
| 701                             const GrPath*, | 704                             const GrPath*, | 
| 702                             const GrClipMaskManager::ScissorState&, | 705                             const GrClipMaskManager::ScissorState&, | 
| 703                             const GrStencilSettings&, | 706                             const GrStencilSettings&, | 
| 704                             const GrDeviceCoordTexture* dstCopy) = 0; | 707                             const GrDeviceCoordTexture* dstCopy) = 0; | 
| 705     virtual void onDrawPaths(const GrDrawState&, | 708     virtual void onDrawPaths(const GrDrawState&, | 
| 706                              const GrPathRange*, | 709                              const GrPathRange*, | 
| 707                              const uint32_t indices[], | 710                              const void* indices, | 
|  | 711                              PathIndexType, | 
|  | 712                              const float transformValues[], | 
|  | 713                              PathTransformType, | 
| 708                              int count, | 714                              int count, | 
| 709                              const float transforms[], |  | 
| 710                              PathTransformType, |  | 
| 711                              const GrClipMaskManager::ScissorState&, | 715                              const GrClipMaskManager::ScissorState&, | 
| 712                              const GrStencilSettings&, | 716                              const GrStencilSettings&, | 
| 713                              const GrDeviceCoordTexture*) = 0; | 717                              const GrDeviceCoordTexture*) = 0; | 
| 714 | 718 | 
| 715     virtual void onClear(const SkIRect* rect, GrColor color, bool canIgnoreRect, | 719     virtual void onClear(const SkIRect* rect, GrColor color, bool canIgnoreRect, | 
| 716                          GrRenderTarget* renderTarget) = 0; | 720                          GrRenderTarget* renderTarget) = 0; | 
| 717 | 721 | 
| 718 | 722 | 
| 719     // helpers for reserving vertex and index space. | 723     // helpers for reserving vertex and index space. | 
| 720     bool reserveVertexSpace(size_t vertexSize, | 724     bool reserveVertexSpace(size_t vertexSize, | 
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 803     virtual bool setupClip(const SkRect* devBounds, | 807     virtual bool setupClip(const SkRect* devBounds, | 
| 804                            GrDrawState::AutoRestoreEffects* are, | 808                            GrDrawState::AutoRestoreEffects* are, | 
| 805                            GrDrawState::AutoRestoreStencil* ars, | 809                            GrDrawState::AutoRestoreStencil* ars, | 
| 806                            GrDrawState*, | 810                            GrDrawState*, | 
| 807                            GrClipMaskManager::ScissorState* scissorState) SK_OVE
     RRIDE; | 811                            GrClipMaskManager::ScissorState* scissorState) SK_OVE
     RRIDE; | 
| 808 | 812 | 
| 809     typedef GrDrawTarget INHERITED; | 813     typedef GrDrawTarget INHERITED; | 
| 810 }; | 814 }; | 
| 811 | 815 | 
| 812 #endif | 816 #endif | 
| OLD | NEW | 
|---|