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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 | 358 |
359 // Called to perform a surface to surface copy. Fallbacks to issuing a draw
from the src to dst | 359 // Called to perform a surface to surface copy. Fallbacks to issuing a draw
from the src to dst |
360 // take place at the GrDrawTarget level and this function implement faster c
opy paths. The rect | 360 // take place at the GrDrawTarget level and this function implement faster c
opy paths. The rect |
361 // and point are pre-clipped. The src rect and implied dst rect are guarante
ed to be within the | 361 // and point are pre-clipped. The src rect and implied dst rect are guarante
ed to be within the |
362 // src/dst bounds and non-empty. | 362 // src/dst bounds and non-empty. |
363 bool copySurface(GrSurface* dst, | 363 bool copySurface(GrSurface* dst, |
364 GrSurface* src, | 364 GrSurface* src, |
365 const SkIRect& srcRect, | 365 const SkIRect& srcRect, |
366 const SkIPoint& dstPoint); | 366 const SkIPoint& dstPoint); |
367 | 367 |
| 368 const GrCaps::MultisampleSpecs& getMultisampleSpecs(GrRenderTarget* rt, |
| 369 const GrStencilSettings&
stencil) { |
| 370 using namespace std::placeholders; |
| 371 const auto& functor = std::bind(&GrGpu::onGetMultisampleSpecs, this, rt,
stencil, _1, _2); |
| 372 return this->caps()->getMultisampleSpecs(rt->desc(), functor); |
| 373 } |
| 374 |
368 struct DrawArgs { | 375 struct DrawArgs { |
369 DrawArgs(const GrPrimitiveProcessor* primProc, | 376 DrawArgs(const GrPrimitiveProcessor* primProc, |
370 const GrPipeline* pipeline, | 377 const GrPipeline* pipeline, |
371 const GrProgramDesc* desc) | 378 const GrProgramDesc* desc) |
372 : fPrimitiveProcessor(primProc) | 379 : fPrimitiveProcessor(primProc) |
373 , fPipeline(pipeline) | 380 , fPipeline(pipeline) |
374 , fDesc(desc) { | 381 , fDesc(desc) { |
375 SkASSERT(primProc && pipeline && desc); | 382 SkASSERT(primProc && pipeline && desc); |
376 } | 383 } |
377 const GrPrimitiveProcessor* fPrimitiveProcessor; | 384 const GrPrimitiveProcessor* fPrimitiveProcessor; |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 | 601 |
595 // overridden by backend-specific derived class to perform the resolve | 602 // overridden by backend-specific derived class to perform the resolve |
596 virtual void onResolveRenderTarget(GrRenderTarget* target) = 0; | 603 virtual void onResolveRenderTarget(GrRenderTarget* target) = 0; |
597 | 604 |
598 // overridden by backend specific derived class to perform the copy surface | 605 // overridden by backend specific derived class to perform the copy surface |
599 virtual bool onCopySurface(GrSurface* dst, | 606 virtual bool onCopySurface(GrSurface* dst, |
600 GrSurface* src, | 607 GrSurface* src, |
601 const SkIRect& srcRect, | 608 const SkIRect& srcRect, |
602 const SkIPoint& dstPoint) = 0; | 609 const SkIPoint& dstPoint) = 0; |
603 | 610 |
| 611 // overridden by backend specific derived class to perform the multisample q
ueries |
| 612 virtual void onGetMultisampleSpecs(GrRenderTarget*, |
| 613 const GrStencilSettings&, |
| 614 int* effectiveSampleCnt, |
| 615 SkAutoTDeleteArray<SkPoint>* samplePatter
n) = 0; |
| 616 |
604 void resetContext() { | 617 void resetContext() { |
605 this->onResetContext(fResetBits); | 618 this->onResetContext(fResetBits); |
606 fResetBits = 0; | 619 fResetBits = 0; |
607 ++fResetTimestamp; | 620 ++fResetTimestamp; |
608 } | 621 } |
609 | 622 |
610 ResetTimestamp fResetTi
mestamp; | 623 ResetTimestamp fResetTi
mestamp; |
611 uint32_t fResetBi
ts; | 624 uint32_t fResetBi
ts; |
612 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. | 625 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
613 GrContext* fContext
; | 626 GrContext* fContext
; |
614 | 627 |
615 friend class GrPathRendering; | 628 friend class GrPathRendering; |
616 typedef SkRefCnt INHERITED; | 629 typedef SkRefCnt INHERITED; |
617 }; | 630 }; |
618 | 631 |
619 #endif | 632 #endif |
OLD | NEW |