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" | 13 #include "GrStencil.h" |
| 14 #include "GrTextureParamsAdjuster.h" |
14 #include "GrXferProcessor.h" | 15 #include "GrXferProcessor.h" |
15 #include "SkPath.h" | 16 #include "SkPath.h" |
16 | 17 |
17 class GrBatchTracker; | 18 class GrBatchTracker; |
18 class GrContext; | 19 class GrContext; |
19 class GrGLContext; | 20 class GrGLContext; |
20 class GrIndexBuffer; | 21 class GrIndexBuffer; |
21 class GrNonInstancedVertices; | 22 class GrNonInstancedVertices; |
22 class GrPath; | 23 class GrPath; |
23 class GrPathRange; | 24 class GrPathRange; |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 | 372 |
372 // width and height may be larger than rt (if underlying API allows it). | 373 // width and height may be larger than rt (if underlying API allows it). |
373 // Returns nullptr if compatible sb could not be created, otherwise the call
er owns the ref on | 374 // Returns nullptr if compatible sb could not be created, otherwise the call
er owns the ref on |
374 // the GrStencilAttachment. | 375 // the GrStencilAttachment. |
375 virtual GrStencilAttachment* createStencilAttachmentForRenderTarget(const Gr
RenderTarget*, | 376 virtual GrStencilAttachment* createStencilAttachmentForRenderTarget(const Gr
RenderTarget*, |
376 int widt
h, | 377 int widt
h, |
377 int heig
ht) = 0; | 378 int heig
ht) = 0; |
378 // clears target's entire stencil buffer to 0 | 379 // clears target's entire stencil buffer to 0 |
379 virtual void clearStencil(GrRenderTarget* target) = 0; | 380 virtual void clearStencil(GrRenderTarget* target) = 0; |
380 | 381 |
| 382 |
| 383 // Determines whether a copy of a texture must be made in order to be compat
ible with |
| 384 // a given GrTextureParams. If so, the width, height and filter used for the
copy are |
| 385 // output via the CopyParams. |
| 386 bool makeCopyForTextureParams(int width, int height, const GrTextureParams&, |
| 387 GrTextureParamsAdjuster::CopyParams*) const; |
| 388 |
381 // This is only to be used in GL-specific tests. | 389 // This is only to be used in GL-specific tests. |
382 virtual const GrGLContext* glContextForTesting() const { return nullptr; } | 390 virtual const GrGLContext* glContextForTesting() const { return nullptr; } |
383 | 391 |
384 protected: | 392 protected: |
385 // Functions used to map clip-respecting stencil tests into normal | 393 // Functions used to map clip-respecting stencil tests into normal |
386 // stencil funcs supported by GPUs. | 394 // stencil funcs supported by GPUs. |
387 static GrStencilFunc ConvertStencilFunc(bool stencilInClip, | 395 static GrStencilFunc ConvertStencilFunc(bool stencilInClip, |
388 GrStencilFunc func); | 396 GrStencilFunc func); |
389 static void ConvertStencilFuncAndMask(GrStencilFunc func, | 397 static void ConvertStencilFuncAndMask(GrStencilFunc func, |
390 bool clipInStencil, | 398 bool clipInStencil, |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 ResetTimestamp fResetTi
mestamp; | 495 ResetTimestamp fResetTi
mestamp; |
488 uint32_t fResetBi
ts; | 496 uint32_t fResetBi
ts; |
489 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. | 497 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
490 GrContext* fContext
; | 498 GrContext* fContext
; |
491 | 499 |
492 friend class GrPathRendering; | 500 friend class GrPathRendering; |
493 typedef SkRefCnt INHERITED; | 501 typedef SkRefCnt INHERITED; |
494 }; | 502 }; |
495 | 503 |
496 #endif | 504 #endif |
OLD | NEW |