OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 GrGpu_DEFINED | 8 #ifndef GrGpu_DEFINED |
9 #define GrGpu_DEFINED | 9 #define GrGpu_DEFINED |
10 | 10 |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 | 342 |
343 enum DrawType { | 343 enum DrawType { |
344 kDrawPoints_DrawType, | 344 kDrawPoints_DrawType, |
345 kDrawLines_DrawType, | 345 kDrawLines_DrawType, |
346 kDrawTriangles_DrawType, | 346 kDrawTriangles_DrawType, |
347 kStencilPath_DrawType, | 347 kStencilPath_DrawType, |
348 kDrawPath_DrawType, | 348 kDrawPath_DrawType, |
349 kDrawPaths_DrawType, | 349 kDrawPaths_DrawType, |
350 }; | 350 }; |
351 | 351 |
| 352 static bool IsPathRenderingDrawType(DrawType type) { |
| 353 return kDrawPath_DrawType == type || kDrawPaths_DrawType == type; |
| 354 } |
| 355 |
352 protected: | 356 protected: |
353 DrawType PrimTypeToDrawType(GrPrimitiveType type) { | 357 DrawType PrimTypeToDrawType(GrPrimitiveType type) { |
354 switch (type) { | 358 switch (type) { |
355 case kTriangles_GrPrimitiveType: | 359 case kTriangles_GrPrimitiveType: |
356 case kTriangleStrip_GrPrimitiveType: | 360 case kTriangleStrip_GrPrimitiveType: |
357 case kTriangleFan_GrPrimitiveType: | 361 case kTriangleFan_GrPrimitiveType: |
358 return kDrawTriangles_DrawType; | 362 return kDrawTriangles_DrawType; |
359 case kPoints_GrPrimitiveType: | 363 case kPoints_GrPrimitiveType: |
360 return kDrawPoints_DrawType; | 364 return kDrawPoints_DrawType; |
361 case kLines_GrPrimitiveType: | 365 case kLines_GrPrimitiveType: |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 // these are mutable so they can be created on-demand | 542 // these are mutable so they can be created on-demand |
539 mutable GrIndexBuffer* fQuadInd
exBuffer; | 543 mutable GrIndexBuffer* fQuadInd
exBuffer; |
540 // Used to abandon/release all resources created by this GrGpu. TODO: Move t
his | 544 // Used to abandon/release all resources created by this GrGpu. TODO: Move t
his |
541 // functionality to GrResourceCache. | 545 // functionality to GrResourceCache. |
542 ObjectList fObjectL
ist; | 546 ObjectList fObjectL
ist; |
543 | 547 |
544 typedef GrDrawTarget INHERITED; | 548 typedef GrDrawTarget INHERITED; |
545 }; | 549 }; |
546 | 550 |
547 #endif | 551 #endif |
OLD | NEW |