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 |
11 #include "GrDrawTarget.h" | 11 #include "GrDrawTarget.h" |
12 #include "GrClipMaskManager.h" | 12 #include "GrClipMaskManager.h" |
13 #include "GrPathRendering.h" | 13 #include "GrPathRendering.h" |
14 #include "SkPath.h" | 14 #include "SkPath.h" |
15 | 15 |
16 class GrContext; | 16 class GrContext; |
17 class GrIndexBufferAllocPool; | 17 class GrIndexBufferAllocPool; |
18 class GrPath; | 18 class GrPath; |
19 class GrPathRange; | 19 class GrPathRange; |
20 class GrPathRenderer; | 20 class GrPathRenderer; |
21 class GrPathRendererChain; | 21 class GrPathRendererChain; |
| 22 class GrProgramDesc; |
22 class GrStencilBuffer; | 23 class GrStencilBuffer; |
23 class GrVertexBufferAllocPool; | 24 class GrVertexBufferAllocPool; |
24 | 25 |
25 class GrGpu : public GrDrawTarget { | 26 class GrGpu : public GrDrawTarget { |
26 public: | 27 public: |
27 | 28 |
28 /** | 29 /** |
29 * Additional blend coefficients for dual source blending, not exposed | 30 * Additional blend coefficients for dual source blending, not exposed |
30 * through GrPaint/GrContext. | 31 * through GrPaint/GrContext. |
31 */ | 32 */ |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 kDrawPath_DrawType, | 342 kDrawPath_DrawType, |
342 kDrawPaths_DrawType, | 343 kDrawPaths_DrawType, |
343 }; | 344 }; |
344 | 345 |
345 static bool IsPathRenderingDrawType(DrawType type) { | 346 static bool IsPathRenderingDrawType(DrawType type) { |
346 return kDrawPath_DrawType == type || kDrawPaths_DrawType == type; | 347 return kDrawPath_DrawType == type || kDrawPaths_DrawType == type; |
347 } | 348 } |
348 | 349 |
349 GrContext::GPUStats* gpuStats() { return &fGPUStats; } | 350 GrContext::GPUStats* gpuStats() { return &fGPUStats; } |
350 | 351 |
| 352 virtual void buildKey(const GrOptDrawState* optState, |
| 353 GrGpu::DrawType drawType, |
| 354 const GrDeviceCoordTexture* dstCopy, |
| 355 GrProgramDesc* desc) = 0; |
| 356 |
351 protected: | 357 protected: |
352 DrawType PrimTypeToDrawType(GrPrimitiveType type) { | 358 DrawType PrimTypeToDrawType(GrPrimitiveType type) { |
353 switch (type) { | 359 switch (type) { |
354 case kTriangles_GrPrimitiveType: | 360 case kTriangles_GrPrimitiveType: |
355 case kTriangleStrip_GrPrimitiveType: | 361 case kTriangleStrip_GrPrimitiveType: |
356 case kTriangleFan_GrPrimitiveType: | 362 case kTriangleFan_GrPrimitiveType: |
357 return kDrawTriangles_DrawType; | 363 return kDrawTriangles_DrawType; |
358 case kPoints_GrPrimitiveType: | 364 case kPoints_GrPrimitiveType: |
359 return kDrawPoints_DrawType; | 365 return kDrawPoints_DrawType; |
360 case kLines_GrPrimitiveType: | 366 case kLines_GrPrimitiveType: |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 // counts number of uses of vertex/index pool in the geometry stack | 534 // counts number of uses of vertex/index pool in the geometry stack |
529 int fVertexP
oolUseCnt; | 535 int fVertexP
oolUseCnt; |
530 int fIndexPo
olUseCnt; | 536 int fIndexPo
olUseCnt; |
531 // these are mutable so they can be created on-demand | 537 // these are mutable so they can be created on-demand |
532 mutable GrIndexBuffer* fQuadInd
exBuffer; | 538 mutable GrIndexBuffer* fQuadInd
exBuffer; |
533 | 539 |
534 typedef GrDrawTarget INHERITED; | 540 typedef GrDrawTarget INHERITED; |
535 }; | 541 }; |
536 | 542 |
537 #endif | 543 #endif |
OLD | NEW |