Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrDrawContext_DEFINED | 8 #ifndef GrDrawContext_DEFINED |
| 9 #define GrDrawContext_DEFINED | 9 #define GrDrawContext_DEFINED |
| 10 | 10 |
| 11 #include "GrColor.h" | 11 #include "GrColor.h" |
| 12 #include "SkRefCnt.h" | 12 #include "SkRefCnt.h" |
| 13 #include "SkSurfaceProps.h" | 13 #include "SkSurfaceProps.h" |
| 14 | 14 |
| 15 class GrBatch; | 15 class GrBatch; |
| 16 class GrClip; | 16 class GrClip; |
| 17 class GrContext; | 17 class GrContext; |
| 18 class GrDrawTarget; | 18 class GrDrawTarget; |
| 19 class GrPaint; | 19 class GrPaint; |
| 20 class GrPathProcessor; | 20 class GrPathProcessor; |
| 21 class GrPathRange; | 21 class GrPathRange; |
| 22 class GrPipelineBuilder; | 22 class GrPipelineBuilder; |
| 23 class GrRenderTarget; | 23 class GrRenderTarget; |
| 24 class GrStrokeInfo; | 24 class GrStrokeInfo; |
| 25 class GrSurface; | 25 class GrSurface; |
| 26 class GrTextContext; | 26 class GrTextContext; |
| 27 class GrTexture; | |
| 27 class SkDrawFilter; | 28 class SkDrawFilter; |
| 28 struct SkIPoint; | 29 struct SkIPoint; |
| 29 struct SkIRect; | 30 struct SkIRect; |
| 30 class SkMatrix; | 31 class SkMatrix; |
| 31 class SkPaint; | 32 class SkPaint; |
| 32 class SkPath; | 33 class SkPath; |
| 33 struct SkPoint; | 34 struct SkPoint; |
| 34 struct SkRect; | 35 struct SkRect; |
| 35 class SkRRect; | 36 class SkRRect; |
| 36 class SkTextBlob; | 37 class SkTextBlob; |
| 37 | 38 |
| 38 /* | 39 /* |
| 39 * A helper object to orchestrate draws | 40 * A helper object to orchestrate draws |
| 40 */ | 41 */ |
| 41 class SK_API GrDrawContext : public SkRefCnt { | 42 class SK_API GrDrawContext : public SkRefCnt { |
| 42 public: | 43 public: |
| 43 ~GrDrawContext() override; | 44 ~GrDrawContext() override; |
| 44 | 45 |
| 46 // This closes off other's draw commands since at this point in its | |
|
bsalomon
2015/07/08 19:06:36
It looks like the user of a GrDrawContext is respo
| |
| 47 // execution its result is needed by the current draw context. | |
| 48 void uses(GrDrawContext* other) {} | |
| 49 | |
| 50 // TODO: ideally we would know if this guy resulted from some draws | |
| 51 void uses(GrTexture* tex) {} | |
| 52 //void done() {} | |
| 53 | |
| 45 void copySurface(GrRenderTarget* dst, GrSurface* src, | 54 void copySurface(GrRenderTarget* dst, GrSurface* src, |
| 46 const SkIRect& srcRect, const SkIPoint& dstPoint); | 55 const SkIRect& srcRect, const SkIPoint& dstPoint); |
| 47 | 56 |
| 48 // TODO: it is odd that we need both the SkPaint in the following 3 methods. | 57 // TODO: it is odd that we need both the SkPaint in the following 3 methods. |
| 49 // We should extract the text parameters from SkPaint and pass them separate ly | 58 // We should extract the text parameters from SkPaint and pass them separate ly |
| 50 // akin to GrStrokeInfo (GrTextInfo?) | 59 // akin to GrStrokeInfo (GrTextInfo?) |
| 51 void drawText(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPaint &, | 60 void drawText(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPaint &, |
| 52 const SkMatrix& viewMatrix, const char text[], size_t byteLeng th, | 61 const SkMatrix& viewMatrix, const char text[], size_t byteLeng th, |
| 53 SkScalar x, SkScalar y, const SkIRect& clipBounds); | 62 SkScalar x, SkScalar y, const SkIRect& clipBounds); |
| 54 void drawPosText(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPai nt&, | 63 void drawPosText(GrRenderTarget*, const GrClip&, const GrPaint&, const SkPai nt&, |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 268 void drawBatch(GrPipelineBuilder* pipelineBuilder, GrBatch* batch); | 277 void drawBatch(GrPipelineBuilder* pipelineBuilder, GrBatch* batch); |
| 269 | 278 |
| 270 GrContext* fContext; // owning context -> no ref | 279 GrContext* fContext; // owning context -> no ref |
| 271 GrDrawTarget* fDrawTarget; | 280 GrDrawTarget* fDrawTarget; |
| 272 GrTextContext* fTextContext; // lazily created | 281 GrTextContext* fTextContext; // lazily created |
| 273 | 282 |
| 274 SkSurfaceProps fSurfaceProps; | 283 SkSurfaceProps fSurfaceProps; |
| 275 }; | 284 }; |
| 276 | 285 |
| 277 #endif | 286 #endif |
| OLD | NEW |