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" | |
13 #include "GrPathRendering.h" | 12 #include "GrPathRendering.h" |
14 #include "GrProgramDesc.h" | 13 #include "GrProgramDesc.h" |
15 #include "SkPath.h" | 14 #include "SkPath.h" |
16 | 15 |
17 class GrContext; | 16 class GrContext; |
18 class GrIndexBufferAllocPool; | 17 class GrIndexBufferAllocPool; |
19 class GrPath; | 18 class GrPath; |
20 class GrPathRange; | 19 class GrPathRange; |
21 class GrPathRenderer; | 20 class GrPathRenderer; |
22 class GrPathRendererChain; | 21 class GrPathRendererChain; |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 291 |
293 // This timestamp is always older than the current timestamp | 292 // This timestamp is always older than the current timestamp |
294 static const ResetTimestamp kExpiredTimestamp = 0; | 293 static const ResetTimestamp kExpiredTimestamp = 0; |
295 // Returns a timestamp based on the number of times the context was reset. | 294 // Returns a timestamp based on the number of times the context was reset. |
296 // This timestamp can be used to lazily detect when cached 3D context state | 295 // This timestamp can be used to lazily detect when cached 3D context state |
297 // is dirty. | 296 // is dirty. |
298 ResetTimestamp getResetTimestamp() const { | 297 ResetTimestamp getResetTimestamp() const { |
299 return fResetTimestamp; | 298 return fResetTimestamp; |
300 } | 299 } |
301 | 300 |
302 enum PrivateDrawStateStateBits { | |
303 kFirstBit = (GrDrawState::kLastPublicStateBit << 1), | |
304 | |
305 kModifyStencilClip_StateBit = kFirstBit, // allows draws to modify | |
306 // stencil bits used for | |
307 // clipping. | |
308 }; | |
309 | |
310 void getPathStencilSettingsForFillType(SkPath::FillType fill, GrStencilSetti
ngs* outStencilSettings); | |
311 | |
312 enum DrawType { | 301 enum DrawType { |
313 kDrawPoints_DrawType, | 302 kDrawPoints_DrawType, |
314 kDrawLines_DrawType, | 303 kDrawLines_DrawType, |
315 kDrawTriangles_DrawType, | 304 kDrawTriangles_DrawType, |
316 kStencilPath_DrawType, | 305 kStencilPath_DrawType, |
317 kDrawPath_DrawType, | 306 kDrawPath_DrawType, |
318 kDrawPaths_DrawType, | 307 kDrawPaths_DrawType, |
319 }; | 308 }; |
320 | 309 |
321 static bool IsPathRenderingDrawType(DrawType type) { | 310 static bool IsPathRenderingDrawType(DrawType type) { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 // stencil funcs supported by GPUs. | 347 // stencil funcs supported by GPUs. |
359 static GrStencilFunc ConvertStencilFunc(bool stencilInClip, | 348 static GrStencilFunc ConvertStencilFunc(bool stencilInClip, |
360 GrStencilFunc func); | 349 GrStencilFunc func); |
361 static void ConvertStencilFuncAndMask(GrStencilFunc func, | 350 static void ConvertStencilFuncAndMask(GrStencilFunc func, |
362 bool clipInStencil, | 351 bool clipInStencil, |
363 unsigned int clipBit, | 352 unsigned int clipBit, |
364 unsigned int userBits, | 353 unsigned int userBits, |
365 unsigned int* ref, | 354 unsigned int* ref, |
366 unsigned int* mask); | 355 unsigned int* mask); |
367 | 356 |
368 GrClipMaskManager fClipMaskManager; | |
369 | |
370 GrContext::GPUStats fGPUStats; | 357 GrContext::GPUStats fGPUStats; |
371 | 358 |
372 struct GeometryPoolState { | 359 struct GeometryPoolState { |
373 const GrVertexBuffer* fPoolVertexBuffer; | 360 const GrVertexBuffer* fPoolVertexBuffer; |
374 int fPoolStartVertex; | 361 int fPoolStartVertex; |
375 | 362 |
376 const GrIndexBuffer* fPoolIndexBuffer; | 363 const GrIndexBuffer* fPoolIndexBuffer; |
377 int fPoolStartIndex; | 364 int fPoolStartIndex; |
378 }; | 365 }; |
379 const GeometryPoolState& getGeomPoolState() { | 366 const GeometryPoolState& getGeomPoolState() { |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 // counts number of uses of vertex/index pool in the geometry stack | 497 // counts number of uses of vertex/index pool in the geometry stack |
511 int fVertexP
oolUseCnt; | 498 int fVertexP
oolUseCnt; |
512 int fIndexPo
olUseCnt; | 499 int fIndexPo
olUseCnt; |
513 // these are mutable so they can be created on-demand | 500 // these are mutable so they can be created on-demand |
514 mutable GrIndexBuffer* fQuadInd
exBuffer; | 501 mutable GrIndexBuffer* fQuadInd
exBuffer; |
515 | 502 |
516 typedef GrClipTarget INHERITED; | 503 typedef GrClipTarget INHERITED; |
517 }; | 504 }; |
518 | 505 |
519 #endif | 506 #endif |
OLD | NEW |