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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 | 335 |
336 enum DrawType { | 336 enum DrawType { |
337 kDrawPoints_DrawType, | 337 kDrawPoints_DrawType, |
338 kDrawLines_DrawType, | 338 kDrawLines_DrawType, |
339 kDrawTriangles_DrawType, | 339 kDrawTriangles_DrawType, |
340 kStencilPath_DrawType, | 340 kStencilPath_DrawType, |
341 kDrawPath_DrawType, | 341 kDrawPath_DrawType, |
342 kDrawPaths_DrawType, | 342 kDrawPaths_DrawType, |
343 }; | 343 }; |
344 | 344 |
| 345 static bool IsPathRenderingDrawType(DrawType type) { |
| 346 return kDrawPath_DrawType == type || kDrawPaths_DrawType == type; |
| 347 } |
| 348 |
345 protected: | 349 protected: |
346 DrawType PrimTypeToDrawType(GrPrimitiveType type) { | 350 DrawType PrimTypeToDrawType(GrPrimitiveType type) { |
347 switch (type) { | 351 switch (type) { |
348 case kTriangles_GrPrimitiveType: | 352 case kTriangles_GrPrimitiveType: |
349 case kTriangleStrip_GrPrimitiveType: | 353 case kTriangleStrip_GrPrimitiveType: |
350 case kTriangleFan_GrPrimitiveType: | 354 case kTriangleFan_GrPrimitiveType: |
351 return kDrawTriangles_DrawType; | 355 return kDrawTriangles_DrawType; |
352 case kPoints_GrPrimitiveType: | 356 case kPoints_GrPrimitiveType: |
353 return kDrawPoints_DrawType; | 357 return kDrawPoints_DrawType; |
354 case kLines_GrPrimitiveType: | 358 case kLines_GrPrimitiveType: |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 // these are mutable so they can be created on-demand | 531 // these are mutable so they can be created on-demand |
528 mutable GrIndexBuffer* fQuadInd
exBuffer; | 532 mutable GrIndexBuffer* fQuadInd
exBuffer; |
529 // Used to abandon/release all resources created by this GrGpu. TODO: Move t
his | 533 // Used to abandon/release all resources created by this GrGpu. TODO: Move t
his |
530 // functionality to GrResourceCache. | 534 // functionality to GrResourceCache. |
531 ObjectList fObjectL
ist; | 535 ObjectList fObjectL
ist; |
532 | 536 |
533 typedef GrDrawTarget INHERITED; | 537 typedef GrDrawTarget INHERITED; |
534 }; | 538 }; |
535 | 539 |
536 #endif | 540 #endif |
OLD | NEW |