Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 GrAARectRenderer_DEFINED | 8 #ifndef GrAARectRenderer_DEFINED |
| 9 #define GrAARectRenderer_DEFINED | 9 #define GrAARectRenderer_DEFINED |
| 10 | 10 |
| 11 #include "GrColor.h" | 11 #include "GrColor.h" |
|
robertphillips
2015/05/04 13:16:00
Do we need this here ?
bsalomon
2015/05/04 15:01:09
Done.
| |
| 12 #include "GrResourceKey.h" | |
| 12 #include "SkMatrix.h" | 13 #include "SkMatrix.h" |
| 13 #include "SkRect.h" | 14 #include "SkRect.h" |
| 14 #include "SkRefCnt.h" | 15 #include "SkRefCnt.h" |
| 15 #include "SkStrokeRec.h" | 16 #include "SkStrokeRec.h" |
| 16 | 17 |
| 17 class GrClip; | 18 class GrClip; |
| 18 class GrDrawTarget; | 19 class GrDrawTarget; |
| 19 class GrGpu; | |
| 20 class GrIndexBuffer; | 20 class GrIndexBuffer; |
| 21 class GrPipelineBuilder; | 21 class GrPipelineBuilder; |
|
robertphillips
2015/05/04 13:16:00
This too?
bsalomon
2015/05/04 15:01:09
Done.
| |
| 22 class GrResourceProvider; | |
| 22 | 23 |
| 23 /* | 24 /* |
| 24 * This class wraps helper functions that draw AA rects (filled & stroked) | 25 * This class wraps helper functions that draw AA rects (filled & stroked) |
| 25 */ | 26 */ |
| 26 class GrAARectRenderer : public SkRefCnt { | 27 class GrAARectRenderer : public SkRefCnt { |
| 27 public: | 28 public: |
| 28 SK_DECLARE_INST_COUNT(GrAARectRenderer) | 29 SK_DECLARE_INST_COUNT(GrAARectRenderer) |
| 29 | 30 |
| 30 GrAARectRenderer(GrGpu* gpu) | |
| 31 : fGpu(gpu) | |
| 32 , fAAFillRectIndexBuffer(NULL) | |
| 33 , fAAMiterStrokeRectIndexBuffer(NULL) | |
| 34 , fAABevelStrokeRectIndexBuffer(NULL) { | |
| 35 } | |
| 36 | |
| 37 void reset(); | |
| 38 | |
| 39 ~GrAARectRenderer() { | |
| 40 this->reset(); | |
| 41 } | |
| 42 | |
| 43 // TODO: potentialy fuse the fill & stroke methods and differentiate | 31 // TODO: potentialy fuse the fill & stroke methods and differentiate |
| 44 // between them by passing in stroke (==NULL means fill). | 32 // between them by passing in stroke (==NULL means fill). |
| 45 | 33 |
| 46 void fillAARect(GrDrawTarget* target, | 34 void fillAARect(GrDrawTarget* target, |
| 47 GrPipelineBuilder* pipelineBuilder, | 35 GrPipelineBuilder* pipelineBuilder, |
| 48 GrColor color, | 36 GrColor color, |
| 49 const SkMatrix& viewMatrix, | 37 const SkMatrix& viewMatrix, |
| 50 const SkRect& rect, | 38 const SkRect& rect, |
| 51 const SkRect& devRect) { | 39 const SkRect& devRect) { |
| 52 this->geometryFillAARect(target, pipelineBuilder, color, viewMatrix, rec t, devRect); | 40 this->geometryFillAARect(target, pipelineBuilder, color, viewMatrix, rec t, devRect); |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 77 | 65 |
| 78 void geometryStrokeAARect(GrDrawTarget*, | 66 void geometryStrokeAARect(GrDrawTarget*, |
| 79 GrPipelineBuilder*, | 67 GrPipelineBuilder*, |
| 80 GrColor, | 68 GrColor, |
| 81 const SkMatrix& viewMatrix, | 69 const SkMatrix& viewMatrix, |
| 82 const SkRect& devOutside, | 70 const SkRect& devOutside, |
| 83 const SkRect& devOutsideAssist, | 71 const SkRect& devOutsideAssist, |
| 84 const SkRect& devInside, | 72 const SkRect& devInside, |
| 85 bool miterStroke); | 73 bool miterStroke); |
| 86 | 74 |
| 87 GrGpu* fGpu; | |
| 88 GrIndexBuffer* fAAFillRectIndexBuffer; | |
| 89 GrIndexBuffer* fAAMiterStrokeRectIndexBuffer; | |
| 90 GrIndexBuffer* fAABevelStrokeRectIndexBuffer; | |
| 91 | |
| 92 typedef SkRefCnt INHERITED; | 75 typedef SkRefCnt INHERITED; |
| 93 }; | 76 }; |
| 94 | 77 |
| 95 #endif // GrAARectRenderer_DEFINED | 78 #endif // GrAARectRenderer_DEFINED |
| OLD | NEW |