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 "GrPipelineBuilder.h" | 11 #include "GrPipelineBuilder.h" |
12 #include "GrProgramDesc.h" | 12 #include "GrProgramDesc.h" |
13 #include "GrStencil.h" | |
14 #include "GrSwizzle.h" | 13 #include "GrSwizzle.h" |
15 #include "GrAllocator.h" | 14 #include "GrAllocator.h" |
16 #include "GrTextureParamsAdjuster.h" | 15 #include "GrTextureParamsAdjuster.h" |
17 #include "GrTypes.h" | 16 #include "GrTypes.h" |
18 #include "GrXferProcessor.h" | 17 #include "GrXferProcessor.h" |
19 #include "SkPath.h" | 18 #include "SkPath.h" |
20 #include "SkTArray.h" | 19 #include "SkTArray.h" |
21 | 20 |
22 class GrBatchTracker; | 21 class GrBatchTracker; |
23 class GrBuffer; | 22 class GrBuffer; |
24 class GrContext; | 23 class GrContext; |
25 class GrGLContext; | 24 class GrGLContext; |
26 class GrMesh; | 25 class GrMesh; |
27 class GrNonInstancedVertices; | 26 class GrNonInstancedVertices; |
28 class GrPath; | 27 class GrPath; |
29 class GrPathRange; | 28 class GrPathRange; |
30 class GrPathRenderer; | 29 class GrPathRenderer; |
31 class GrPathRendererChain; | 30 class GrPathRendererChain; |
32 class GrPathRendering; | 31 class GrPathRendering; |
33 class GrPipeline; | 32 class GrPipeline; |
34 class GrPrimitiveProcessor; | 33 class GrPrimitiveProcessor; |
35 class GrRenderTarget; | 34 class GrRenderTarget; |
36 class GrStencilAttachment; | 35 class GrStencilAttachment; |
| 36 class GrStencilSettings; |
37 class GrSurface; | 37 class GrSurface; |
38 class GrTexture; | 38 class GrTexture; |
39 | 39 |
40 class GrGpu : public SkRefCnt { | 40 class GrGpu : public SkRefCnt { |
41 public: | 41 public: |
42 /** | 42 /** |
43 * Create an instance of GrGpu that matches the specified backend. If the re
quested backend is | 43 * Create an instance of GrGpu that matches the specified backend. If the re
quested backend is |
44 * not supported (at compile-time or run-time) this returns nullptr. The con
text will not be | 44 * not supported (at compile-time or run-time) this returns nullptr. The con
text will not be |
45 * fully constructed and should not be used by GrGpu until after this functi
on returns. | 45 * fully constructed and should not be used by GrGpu until after this functi
on returns. |
46 */ | 46 */ |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 return this->onMakeCopyForTextureParams(texture, params, copyParams); | 478 return this->onMakeCopyForTextureParams(texture, params, copyParams); |
479 } | 479 } |
480 | 480 |
481 // This is only to be used in GL-specific tests. | 481 // This is only to be used in GL-specific tests. |
482 virtual const GrGLContext* glContextForTesting() const { return nullptr; } | 482 virtual const GrGLContext* glContextForTesting() const { return nullptr; } |
483 | 483 |
484 // This is only to be used by testing code | 484 // This is only to be used by testing code |
485 virtual void resetShaderCacheForTesting() const {} | 485 virtual void resetShaderCacheForTesting() const {} |
486 | 486 |
487 protected: | 487 protected: |
488 // Functions used to map clip-respecting stencil tests into normal | |
489 // stencil funcs supported by GPUs. | |
490 static GrStencilFunc ConvertStencilFunc(bool stencilInClip, | |
491 GrStencilFunc func); | |
492 static void ConvertStencilFuncAndMask(GrStencilFunc func, | |
493 bool clipInStencil, | |
494 unsigned int clipBit, | |
495 unsigned int userBits, | |
496 unsigned int* ref, | |
497 unsigned int* mask); | |
498 | |
499 static void ElevateDrawPreference(GrGpu::DrawPreference* preference, | 488 static void ElevateDrawPreference(GrGpu::DrawPreference* preference, |
500 GrGpu::DrawPreference elevation) { | 489 GrGpu::DrawPreference elevation) { |
501 GR_STATIC_ASSERT(GrGpu::kCallerPrefersDraw_DrawPreference > GrGpu::kNoDr
aw_DrawPreference); | 490 GR_STATIC_ASSERT(GrGpu::kCallerPrefersDraw_DrawPreference > GrGpu::kNoDr
aw_DrawPreference); |
502 GR_STATIC_ASSERT(GrGpu::kGpuPrefersDraw_DrawPreference > | 491 GR_STATIC_ASSERT(GrGpu::kGpuPrefersDraw_DrawPreference > |
503 GrGpu::kCallerPrefersDraw_DrawPreference); | 492 GrGpu::kCallerPrefersDraw_DrawPreference); |
504 GR_STATIC_ASSERT(GrGpu::kRequireDraw_DrawPreference > | 493 GR_STATIC_ASSERT(GrGpu::kRequireDraw_DrawPreference > |
505 GrGpu::kGpuPrefersDraw_DrawPreference); | 494 GrGpu::kGpuPrefersDraw_DrawPreference); |
506 *preference = SkTMax(*preference, elevation); | 495 *preference = SkTMax(*preference, elevation); |
507 } | 496 } |
508 | 497 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 SkTArray<const MultisampleSpecs*, true> fMultisa
mpleSpecsMap; | 603 SkTArray<const MultisampleSpecs*, true> fMultisa
mpleSpecsMap; |
615 GrTAllocator<MultisampleSpecs> fMultisa
mpleSpecsAllocator; | 604 GrTAllocator<MultisampleSpecs> fMultisa
mpleSpecsAllocator; |
616 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. | 605 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
617 GrContext* fContext
; | 606 GrContext* fContext
; |
618 | 607 |
619 friend class GrPathRendering; | 608 friend class GrPathRendering; |
620 typedef SkRefCnt INHERITED; | 609 typedef SkRefCnt INHERITED; |
621 }; | 610 }; |
622 | 611 |
623 #endif | 612 #endif |
OLD | NEW |