| 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 GrPath_DEFINED | 8 #ifndef GrPath_DEFINED |
| 9 #define GrPath_DEFINED | 9 #define GrPath_DEFINED |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #endif | 29 #endif |
| 30 { | 30 { |
| 31 } | 31 } |
| 32 | 32 |
| 33 static void ComputeKey(const SkPath& path, const GrStrokeInfo& stroke, GrUni
queKey* key, | 33 static void ComputeKey(const SkPath& path, const GrStrokeInfo& stroke, GrUni
queKey* key, |
| 34 bool* outIsVolatile); | 34 bool* outIsVolatile); |
| 35 | 35 |
| 36 const SkRect& getBounds() const { return fBounds; } | 36 const SkRect& getBounds() const { return fBounds; } |
| 37 | 37 |
| 38 GrPathRendering::FillType getFillType() const { return fFillType; } | 38 GrPathRendering::FillType getFillType() const { return fFillType; } |
| 39 |
| 40 /** |
| 41 * Returns true if a path can be drawn in the same draw paths operation as t
he other |
| 42 * path. Should return true only when the condition holds transitively with
all other paths in |
| 43 * the same group. |
| 44 * E.g. |
| 45 * canCombineDrawPathBatchWith(a) AND canCombineDrawPathBatchWith(b) |
| 46 * canCombineDrawPathBatchWith(a) AND canCombineDrawPathBatchWith(c) |
| 47 * implies |
| 48 * canCombineDrawPathBatchWith(b) AND canCombineDrawPathBatchWith(c) |
| 49 */ |
| 50 virtual bool canCombineDrawPathBatchWith(const GrPath& other) const = 0; |
| 39 #ifdef SK_DEBUG | 51 #ifdef SK_DEBUG |
| 40 bool isEqualTo(const SkPath& path, const GrStrokeInfo& stroke) const; | 52 bool isEqualTo(const SkPath& path, const GrStrokeInfo& stroke) const; |
| 41 #endif | 53 #endif |
| 42 | 54 |
| 43 protected: | 55 protected: |
| 44 // Subclass should init these. | 56 // Subclass should init these. |
| 45 SkRect fBounds; | 57 SkRect fBounds; |
| 46 GrPathRendering::FillType fFillType; | 58 GrPathRendering::FillType fFillType; |
| 47 #ifdef SK_DEBUG | 59 #ifdef SK_DEBUG |
| 48 SkPath fSkPath; | 60 SkPath fSkPath; |
| 49 GrStrokeInfo fStroke; | 61 GrStrokeInfo fStroke; |
| 50 #endif | 62 #endif |
| 51 | 63 |
| 52 private: | 64 private: |
| 53 typedef GrGpuResource INHERITED; | 65 typedef GrGpuResource INHERITED; |
| 54 }; | 66 }; |
| 55 | 67 |
| 56 #endif | 68 #endif |
| OLD | NEW |