OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 #include "GrClipMaskManager.h" | 8 #include "GrClipMaskManager.h" |
9 #include "GrCaps.h" | 9 #include "GrCaps.h" |
10 #include "GrDrawingManager.h" | 10 #include "GrDrawingManager.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "effects/GrConvexPolyEffect.h" | 23 #include "effects/GrConvexPolyEffect.h" |
24 #include "effects/GrPorterDuffXferProcessor.h" | 24 #include "effects/GrPorterDuffXferProcessor.h" |
25 #include "effects/GrRRectEffect.h" | 25 #include "effects/GrRRectEffect.h" |
26 #include "effects/GrTextureDomain.h" | 26 #include "effects/GrTextureDomain.h" |
27 | 27 |
28 typedef SkClipStack::Element Element; | 28 typedef SkClipStack::Element Element; |
29 | 29 |
30 //////////////////////////////////////////////////////////////////////////////// | 30 //////////////////////////////////////////////////////////////////////////////// |
31 // set up the draw state to enable the aa clipping mask. Besides setting up the | 31 // set up the draw state to enable the aa clipping mask. Besides setting up the |
32 // stage matrix this also alters the vertex layout | 32 // stage matrix this also alters the vertex layout |
33 static const GrFragmentProcessor* create_fp_for_mask(GrTexture* result, const Sk
IRect &devBound) { | 33 static const GrFragmentProcessor* create_fp_for_mask(GrTexture* result, const Sk
IRect &devBound, GrRenderTarget* dst) { |
| 34 |
34 SkMatrix mat; | 35 SkMatrix mat; |
35 // We use device coords to compute the texture coordinates. We set our matri
x to be a | 36 // We use device coords to compute the texture coordinates. We set our matri
x to be a |
36 // translation to the devBound, and then a scaling matrix to normalized coor
ds. | 37 // translation to the devBound, and then a scaling matrix to normalized coor
ds. |
37 mat.setIDiv(result->width(), result->height()); | 38 mat.setIDiv(result->width(), result->height()); |
38 mat.preTranslate(SkIntToScalar(-devBound.fLeft), | 39 mat.preTranslate(SkIntToScalar(-devBound.fLeft), |
39 SkIntToScalar(-devBound.fTop)); | 40 SkIntToScalar(-devBound.fTop)); |
40 | 41 |
41 SkIRect domainTexels = SkIRect::MakeWH(devBound.width(), devBound.height()); | 42 SkIRect domainTexels = SkIRect::MakeWH(devBound.width(), devBound.height()); |
42 return GrTextureDomainEffect::Create(result, | 43 return GrTextureDomainEffect::Create(result, |
43 mat, | 44 mat, |
44 GrTextureDomain::MakeTexelDomain(result
, domainTexels), | 45 GrTextureDomain::MakeTexelDomain(result
, domainTexels), |
45 GrTextureDomain::kDecal_Mode, | 46 GrTextureDomain::kDecal_Mode, |
46 GrTextureParams::kNone_FilterMode, | 47 GrTextureParams::kNone_FilterMode, |
47 kDevice_GrCoordSet); | 48 kDevice_GrCoordSet, dst); |
48 } | 49 } |
49 | 50 |
50 // Does the path in 'element' require SW rendering? If so, return true (and, | 51 // Does the path in 'element' require SW rendering? If so, return true (and, |
51 // optionally, set 'prOut' to NULL. If not, return false (and, optionally, set | 52 // optionally, set 'prOut' to NULL. If not, return false (and, optionally, set |
52 // 'prOut' to the non-SW path renderer that will do the job). | 53 // 'prOut' to the non-SW path renderer that will do the job). |
53 bool GrClipMaskManager::PathNeedsSWRenderer(GrContext* context, | 54 bool GrClipMaskManager::PathNeedsSWRenderer(GrContext* context, |
54 bool isStencilDisabled, | 55 bool isStencilDisabled, |
55 const GrRenderTarget* rt, | 56 const GrRenderTarget* rt, |
56 const SkMatrix& viewMatrix, | 57 const SkMatrix& viewMatrix, |
57 const Element* element, | 58 const Element* element, |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 } | 272 } |
272 return !failed; | 273 return !failed; |
273 } | 274 } |
274 | 275 |
275 //////////////////////////////////////////////////////////////////////////////// | 276 //////////////////////////////////////////////////////////////////////////////// |
276 // sort out what kind of clip mask needs to be created: alpha, stencil, | 277 // sort out what kind of clip mask needs to be created: alpha, stencil, |
277 // scissor, or entirely software | 278 // scissor, or entirely software |
278 bool GrClipMaskManager::setupClipping(const GrPipelineBuilder& pipelineBuilder, | 279 bool GrClipMaskManager::setupClipping(const GrPipelineBuilder& pipelineBuilder, |
279 GrPipelineBuilder::AutoRestoreStencil* ars
, | 280 GrPipelineBuilder::AutoRestoreStencil* ars
, |
280 const SkRect* devBounds, | 281 const SkRect* devBounds, |
281 GrAppliedClip* out) { | 282 GrAppliedClip* out, |
| 283 GrRenderTarget* dst) { |
282 if (kRespectClip_StencilClipMode == fClipMode) { | 284 if (kRespectClip_StencilClipMode == fClipMode) { |
283 fClipMode = kIgnoreClip_StencilClipMode; | 285 fClipMode = kIgnoreClip_StencilClipMode; |
284 } | 286 } |
285 | 287 |
286 GrReducedClip::ElementList elements(16); | 288 GrReducedClip::ElementList elements(16); |
287 int32_t genID = 0; | 289 int32_t genID = 0; |
288 GrReducedClip::InitialState initialState = GrReducedClip::kAllIn_InitialStat
e; | 290 GrReducedClip::InitialState initialState = GrReducedClip::kAllIn_InitialStat
e; |
289 SkIRect clipSpaceIBounds; | 291 SkIRect clipSpaceIBounds; |
290 bool requiresAA = false; | 292 bool requiresAA = false; |
291 GrRenderTarget* rt = pipelineBuilder.getRenderTarget(); | 293 GrRenderTarget* rt = pipelineBuilder.getRenderTarget(); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 out->fScissorState.set(scissorSpaceIBounds); | 365 out->fScissorState.set(scissorSpaceIBounds); |
364 } | 366 } |
365 this->setPipelineBuilderStencil(pipelineBuilder, ars); | 367 this->setPipelineBuilderStencil(pipelineBuilder, ars); |
366 out->fClipCoverageFP.reset(clipFP); | 368 out->fClipCoverageFP.reset(clipFP); |
367 return true; | 369 return true; |
368 } | 370 } |
369 } | 371 } |
370 | 372 |
371 // If MSAA is enabled we can do everything in the stencil buffer. | 373 // If MSAA is enabled we can do everything in the stencil buffer. |
372 if (0 == rt->numStencilSamples() && requiresAA) { | 374 if (0 == rt->numStencilSamples() && requiresAA) { |
| 375 SkAutoTUnref<GrDrawContext> dc; |
373 SkAutoTUnref<GrTexture> result; | 376 SkAutoTUnref<GrTexture> result; |
374 | 377 |
375 // The top-left of the mask corresponds to the top-left corner of the bo
unds. | 378 // The top-left of the mask corresponds to the top-left corner of the bo
unds. |
376 SkVector clipToMaskOffset = { | 379 SkVector clipToMaskOffset = { |
377 SkIntToScalar(-clipSpaceIBounds.fLeft), | 380 SkIntToScalar(-clipSpaceIBounds.fLeft), |
378 SkIntToScalar(-clipSpaceIBounds.fTop) | 381 SkIntToScalar(-clipSpaceIBounds.fTop) |
379 }; | 382 }; |
380 | 383 |
381 if (this->useSWOnlyPath(pipelineBuilder, rt, clipToMaskOffset, elements)
) { | 384 if (this->useSWOnlyPath(pipelineBuilder, rt, clipToMaskOffset, elements)
) { |
382 // The clip geometry is complex enough that it will be more efficien
t to create it | 385 // The clip geometry is complex enough that it will be more efficien
t to create it |
383 // entirely in software | 386 // entirely in software |
384 result.reset(this->createSoftwareClipMask(genID, | 387 result.reset(this->createSoftwareClipMask(genID, |
385 initialState, | 388 initialState, |
386 elements, | 389 elements, |
387 clipToMaskOffset, | 390 clipToMaskOffset, |
388 clipSpaceIBounds)); | 391 clipSpaceIBounds)); |
389 } else { | 392 } else { |
390 result.reset(this->createAlphaClipMask(genID, | 393 result.reset(this->createAlphaClipMask(genID, |
391 initialState, | 394 initialState, |
392 elements, | 395 elements, |
393 clipToMaskOffset, | 396 clipToMaskOffset, |
394 clipSpaceIBounds)); | 397 clipSpaceIBounds, &dc)); |
395 // If createAlphaClipMask fails it means useSWOnlyPath has a bug | 398 // If createAlphaClipMask fails it means useSWOnlyPath has a bug |
396 SkASSERT(result); | 399 SkASSERT(result); |
397 } | 400 } |
398 | 401 |
399 if (result) { | 402 if (result) { |
400 // The mask's top left coord should be pinned to the rounded-out top
left corner of | 403 // The mask's top left coord should be pinned to the rounded-out top
left corner of |
401 // clipSpace bounds. We determine the mask's position WRT to the ren
der target here. | 404 // clipSpace bounds. We determine the mask's position WRT to the ren
der target here. |
402 SkIRect rtSpaceMaskBounds = clipSpaceIBounds; | 405 SkIRect rtSpaceMaskBounds = clipSpaceIBounds; |
403 rtSpaceMaskBounds.offset(-clip.origin()); | 406 rtSpaceMaskBounds.offset(-clip.origin()); |
404 out->fClipCoverageFP.reset(create_fp_for_mask(result, rtSpaceMaskBou
nds)); | 407 out->fClipCoverageFP.reset(create_fp_for_mask(result, rtSpaceMaskBou
nds, dst)); |
405 this->setPipelineBuilderStencil(pipelineBuilder, ars); | 408 this->setPipelineBuilderStencil(pipelineBuilder, ars); |
406 return true; | 409 return true; |
407 } | 410 } |
408 // if alpha clip mask creation fails fall through to the non-AA code pat
hs | 411 // if alpha clip mask creation fails fall through to the non-AA code pat
hs |
409 } | 412 } |
410 | 413 |
411 // use the stencil clip if we can't represent the clip as a rectangle. | 414 // use the stencil clip if we can't represent the clip as a rectangle. |
412 SkIPoint clipSpaceToStencilSpaceOffset = -clip.origin(); | 415 SkIPoint clipSpaceToStencilSpaceOffset = -clip.origin(); |
413 this->createStencilClipMask(rt, | 416 this->createStencilClipMask(rt, |
414 genID, | 417 genID, |
(...skipping 29 matching lines...) Expand all Loading... |
444 const SkClipStack::Element* element, | 447 const SkClipStack::Element* element, |
445 GrPathRenderer* pr) { | 448 GrPathRenderer* pr) { |
446 | 449 |
447 GrRenderTarget* rt = target->asRenderTarget(); | 450 GrRenderTarget* rt = target->asRenderTarget(); |
448 pipelineBuilder->setRenderTarget(rt); | 451 pipelineBuilder->setRenderTarget(rt); |
449 | 452 |
450 // The color we use to draw does not matter since we will always be using a
GrCoverageSetOpXP | 453 // The color we use to draw does not matter since we will always be using a
GrCoverageSetOpXP |
451 // which ignores color. | 454 // which ignores color. |
452 GrColor color = GrColor_WHITE; | 455 GrColor color = GrColor_WHITE; |
453 | 456 |
| 457 GrPaint paint; |
| 458 paint.setAntiAlias(element->isAA()); |
| 459 GrClip clip; |
| 460 |
454 // TODO: Draw rrects directly here. | 461 // TODO: Draw rrects directly here. |
455 switch (element->getType()) { | 462 switch (element->getType()) { |
456 case Element::kEmpty_Type: | 463 case Element::kEmpty_Type: |
457 SkDEBUGFAIL("Should never get here with an empty element."); | 464 SkDEBUGFAIL("Should never get here with an empty element."); |
458 break; | 465 break; |
459 case Element::kRect_Type: | 466 case Element::kRect_Type: { |
460 // TODO: Do rects directly to the accumulator using a aa-rect GrProc
essor that covers | 467 // TODO: Do rects directly to the accumulator using a aa-rect GrProc
essor that covers |
461 // the entire mask bounds and writes 0 outside the rect. | 468 // the entire mask bounds and writes 0 outside the rect. |
462 if (element->isAA()) { | 469 if (element->isAA()) { |
463 SkRect devRect = element->getRect(); | 470 SkRect devRect = element->getRect(); |
464 viewMatrix.mapRect(&devRect); | 471 viewMatrix.mapRect(&devRect); |
465 | 472 |
466 fDrawTarget->drawAARect(*pipelineBuilder, color, viewMatrix, | 473 fDrawTarget->drawAARect(*pipelineBuilder, color, viewMatrix, |
467 element->getRect(), devRect); | 474 element->getRect(), devRect); |
468 } else { | 475 } else { |
469 fDrawTarget->drawNonAARect(*pipelineBuilder, color, viewMatrix, | 476 fDrawTarget->drawNonAARect(*pipelineBuilder, color, viewMatrix, |
470 element->getRect()); | 477 element->getRect()); |
471 } | 478 } |
472 return true; | 479 return true; |
| 480 } |
473 default: { | 481 default: { |
474 SkPath path; | 482 SkPath path; |
475 element->asPath(&path); | 483 element->asPath(&path); |
476 if (path.isInverseFillType()) { | 484 if (path.isInverseFillType()) { |
477 path.toggleInverseFillType(); | 485 path.toggleInverseFillType(); |
478 } | 486 } |
479 GrStrokeInfo stroke(SkStrokeRec::kFill_InitStyle); | 487 GrStrokeInfo stroke(SkStrokeRec::kFill_InitStyle); |
| 488 |
480 if (nullptr == pr) { | 489 if (nullptr == pr) { |
481 GrPathRendererChain::DrawType type; | 490 GrPathRendererChain::DrawType type; |
482 type = element->isAA() ? GrPathRendererChain::kColorAntiAlias_Dr
awType : | 491 type = element->isAA() ? GrPathRendererChain::kColorAntiAlias_Dr
awType : |
483 GrPathRendererChain::kColor_DrawType; | 492 GrPathRendererChain::kColor_DrawType; |
484 | 493 |
485 GrPathRenderer::CanDrawPathArgs canDrawArgs; | 494 GrPathRenderer::CanDrawPathArgs canDrawArgs; |
486 canDrawArgs.fShaderCaps = this->getContext()->caps()->shaderCaps
(); | 495 canDrawArgs.fShaderCaps = this->getContext()->caps()->shaderCaps
(); |
487 canDrawArgs.fViewMatrix = &viewMatrix; | 496 canDrawArgs.fViewMatrix = &viewMatrix; |
488 canDrawArgs.fPath = &path; | 497 canDrawArgs.fPath = &path; |
489 canDrawArgs.fStroke = &stroke; | 498 canDrawArgs.fStroke = &stroke; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 return nullptr; | 549 return nullptr; |
541 } | 550 } |
542 texture->resourcePriv().setUniqueKey(key); | 551 texture->resourcePriv().setUniqueKey(key); |
543 return texture; | 552 return texture; |
544 } | 553 } |
545 | 554 |
546 GrTexture* GrClipMaskManager::createAlphaClipMask(int32_t elementsGenID, | 555 GrTexture* GrClipMaskManager::createAlphaClipMask(int32_t elementsGenID, |
547 GrReducedClip::InitialState in
itialState, | 556 GrReducedClip::InitialState in
itialState, |
548 const GrReducedClip::ElementLi
st& elements, | 557 const GrReducedClip::ElementLi
st& elements, |
549 const SkVector& clipToMaskOffs
et, | 558 const SkVector& clipToMaskOffs
et, |
550 const SkIRect& clipSpaceIBound
s) { | 559 const SkIRect& clipSpaceIBound
s, |
| 560 SkAutoTUnref<GrDrawContext>* d
estDC) { |
551 GrResourceProvider* resourceProvider = this->resourceProvider(); | 561 GrResourceProvider* resourceProvider = this->resourceProvider(); |
552 GrUniqueKey key; | 562 GrUniqueKey key; |
553 GetClipMaskKey(elementsGenID, clipSpaceIBounds, &key); | 563 GetClipMaskKey(elementsGenID, clipSpaceIBounds, &key); |
554 if (GrTexture* texture = resourceProvider->findAndRefTextureByUniqueKey(key)
) { | 564 if (GrTexture* texture = resourceProvider->findAndRefTextureByUniqueKey(key)
) { |
555 return texture; | 565 return texture; |
556 } | 566 } |
557 | 567 |
558 // There's no texture in the cache. Let's try to allocate it then. | 568 // There's no texture in the cache. Let's try to allocate it then. |
559 SkAutoTUnref<GrTexture> texture(this->createCachedMask( | 569 SkAutoTUnref<GrTexture> texture(this->createCachedMask( |
560 clipSpaceIBounds.width(), clipSpaceIBounds.height(), key, true)); | 570 clipSpaceIBounds.width(), clipSpaceIBounds.height(), key, true)); |
561 if (!texture) { | 571 if (!texture) { |
562 return nullptr; | 572 return nullptr; |
563 } | 573 } |
564 | 574 |
| 575 destDC->reset(this->getContext()->drawContext(texture->asRenderTarget())); |
| 576 if (!*destDC) { |
| 577 texture->unref(); |
| 578 return NULL; |
| 579 } |
| 580 |
565 // Set the matrix so that rendered clip elements are transformed to mask spa
ce from clip | 581 // Set the matrix so that rendered clip elements are transformed to mask spa
ce from clip |
566 // space. | 582 // space. |
567 const SkMatrix translate = SkMatrix::MakeTrans(clipToMaskOffset.fX, clipToMa
skOffset.fY); | 583 const SkMatrix translate = SkMatrix::MakeTrans(clipToMaskOffset.fX, clipToMa
skOffset.fY); |
568 | 584 |
569 // The texture may be larger than necessary, this rect represents the part o
f the texture | 585 // The texture may be larger than necessary, this rect represents the part o
f the texture |
570 // we populate with a rasterization of the clip. | 586 // we populate with a rasterization of the clip. |
571 SkIRect maskSpaceIBounds = SkIRect::MakeWH(clipSpaceIBounds.width(), clipSpa
ceIBounds.height()); | 587 SkIRect maskSpaceIBounds = SkIRect::MakeWH(clipSpaceIBounds.width(), clipSpa
ceIBounds.height()); |
572 | 588 |
573 // The scratch texture that we are drawing into can be substantially larger
than the mask. Only | 589 // The scratch texture that we are drawing into can be substantially larger
than the mask. Only |
574 // clear the part that we care about. | 590 // clear the part that we care about. |
| 591 #if 1 |
| 592 (*destDC)->clear(&maskSpaceIBounds, |
| 593 GrReducedClip::kAllIn_InitialState == initialState ? 0xffff
ffff : 0x00000000, |
| 594 true); |
| 595 #else |
575 fDrawTarget->clear(&maskSpaceIBounds, | 596 fDrawTarget->clear(&maskSpaceIBounds, |
576 GrReducedClip::kAllIn_InitialState == initialState ? 0xff
ffffff : 0x00000000, | 597 GrReducedClip::kAllIn_InitialState == initialState ? 0xff
ffffff : 0x00000000, |
577 true, | 598 true, |
578 texture->asRenderTarget()); | 599 texture->asRenderTarget()); |
| 600 #endif |
579 | 601 |
580 // When we use the stencil in the below loop it is important to have this cl
ip installed. | 602 // When we use the stencil in the below loop it is important to have this cl
ip installed. |
581 // The second pass that zeros the stencil buffer renders the rect maskSpaceI
Bounds so the first | 603 // The second pass that zeros the stencil buffer renders the rect maskSpaceI
Bounds so the first |
582 // pass must not set values outside of this bounds or stencil values outside
the rect won't be | 604 // pass must not set values outside of this bounds or stencil values outside
the rect won't be |
583 // cleared. | 605 // cleared. |
584 const GrClip clip(maskSpaceIBounds); | 606 const GrClip clip(maskSpaceIBounds); |
585 | 607 |
586 // walk through each clip element and perform its set op | 608 // walk through each clip element and perform its set op |
587 for (GrReducedClip::ElementList::Iter iter = elements.headIter(); iter.get()
; iter.next()) { | 609 for (GrReducedClip::ElementList::Iter iter = elements.headIter(); iter.get()
; iter.next()) { |
588 const Element* element = iter.get(); | 610 const Element* element = iter.get(); |
589 SkRegion::Op op = element->getOp(); | 611 SkRegion::Op op = element->getOp(); |
590 bool invert = element->isInverseFilled(); | 612 bool invert = element->isInverseFilled(); |
591 if (invert || SkRegion::kIntersect_Op == op || SkRegion::kReverseDiffere
nce_Op == op) { | 613 if (invert || SkRegion::kIntersect_Op == op || SkRegion::kReverseDiffere
nce_Op == op) { |
592 | |
593 GrPathRenderer* pr = GetPathRenderer(this->getContext(), | 614 GrPathRenderer* pr = GetPathRenderer(this->getContext(), |
594 texture, translate, element); | 615 texture, translate, element); |
595 if (Element::kRect_Type != element->getType() && !pr) { | 616 if (Element::kRect_Type != element->getType() && !pr) { |
596 // useSWOnlyPath should now filter out all cases where gpu-side
mask merging would | 617 // useSWOnlyPath should now filter out all cases where gpu-side
mask merging would |
597 // be performed (i.e., pr would be NULL for a non-rect path). Se
e https://bug.skia.org/4519 | 618 // be performed (i.e., pr would be NULL for a non-rect path). Se
e https://bug.skia.org/4519 |
598 // for rationale and details. | 619 // for rationale and details. |
599 SkASSERT(0); | 620 SkASSERT(0); |
600 continue; | 621 continue; |
601 } | 622 } |
602 | 623 |
(...skipping 30 matching lines...) Expand all Loading... |
633 // Draw to the exterior pixels (those with a zero stencil value)
. | 654 // Draw to the exterior pixels (those with a zero stencil value)
. |
634 GR_STATIC_CONST_SAME_STENCIL(kDrawOutsideElement, | 655 GR_STATIC_CONST_SAME_STENCIL(kDrawOutsideElement, |
635 kZero_StencilOp, | 656 kZero_StencilOp, |
636 kZero_StencilOp, | 657 kZero_StencilOp, |
637 kEqual_StencilFunc, | 658 kEqual_StencilFunc, |
638 0xffff, | 659 0xffff, |
639 0x0000, | 660 0x0000, |
640 0xffff); | 661 0xffff); |
641 backgroundPipelineBuilder.setStencil(kDrawOutsideElement); | 662 backgroundPipelineBuilder.setStencil(kDrawOutsideElement); |
642 | 663 |
| 664 #if 0 |
643 // The color passed in here does not matter since the coverageSe
tOpXP won't read it. | 665 // The color passed in here does not matter since the coverageSe
tOpXP won't read it. |
644 fDrawTarget->drawNonAARect(backgroundPipelineBuilder, GrColor_WH
ITE, translate, | 666 fDrawTarget->drawNonAARect(backgroundPipelineBuilder, GrColor_WH
ITE, translate, |
645 clipSpaceIBounds); | 667 clipSpaceIBounds); |
| 668 #else |
| 669 GrClip clip; |
| 670 GrPaint paint; |
| 671 (*destDC)->drawRect(clip, paint, SkMatrix::I(), SkRect::Make(cli
pSpaceIBounds), NULL); |
| 672 #endif |
646 } | 673 } |
647 } else { | 674 } else { |
648 GrPipelineBuilder pipelineBuilder; | 675 GrPipelineBuilder pipelineBuilder; |
649 | 676 |
650 // all the remaining ops can just be directly draw into the accumula
tion buffer | 677 // all the remaining ops can just be directly draw into the accumula
tion buffer |
651 set_coverage_drawing_xpf(op, false, &pipelineBuilder); | 678 set_coverage_drawing_xpf(op, false, &pipelineBuilder); |
652 // The color passed in here does not matter since the coverageSetOpX
P won't read it. | 679 // The color passed in here does not matter since the coverageSetOpX
P won't read it. |
653 this->drawElement(&pipelineBuilder, translate, texture, element); | 680 this->drawElement(&pipelineBuilder, translate, texture, element); |
654 } | 681 } |
655 } | 682 } |
656 | 683 |
| 684 // This was written to but will have a unique key |
| 685 texture->fException2 = true; |
| 686 |
657 return texture.detach(); | 687 return texture.detach(); |
658 } | 688 } |
659 | 689 |
660 //////////////////////////////////////////////////////////////////////////////// | 690 //////////////////////////////////////////////////////////////////////////////// |
661 // Create a 1-bit clip mask in the stencil buffer. 'devClipBounds' are in device | 691 // Create a 1-bit clip mask in the stencil buffer. 'devClipBounds' are in device |
662 // (as opposed to canvas) coordinates | 692 // (as opposed to canvas) coordinates |
663 bool GrClipMaskManager::createStencilClipMask(GrRenderTarget* rt, | 693 bool GrClipMaskManager::createStencilClipMask(GrRenderTarget* rt, |
664 int32_t elementsGenID, | 694 int32_t elementsGenID, |
665 GrReducedClip::InitialState initia
lState, | 695 GrReducedClip::InitialState initia
lState, |
666 const GrReducedClip::ElementList&
elements, | 696 const GrReducedClip::ElementList&
elements, |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 | 1126 |
1097 //////////////////////////////////////////////////////////////////////////////// | 1127 //////////////////////////////////////////////////////////////////////////////// |
1098 | 1128 |
1099 void GrClipMaskManager::adjustPathStencilParams(const GrStencilAttachment* stenc
ilAttachment, | 1129 void GrClipMaskManager::adjustPathStencilParams(const GrStencilAttachment* stenc
ilAttachment, |
1100 GrStencilSettings* settings) { | 1130 GrStencilSettings* settings) { |
1101 if (stencilAttachment) { | 1131 if (stencilAttachment) { |
1102 int stencilBits = stencilAttachment->bits(); | 1132 int stencilBits = stencilAttachment->bits(); |
1103 this->adjustStencilParams(settings, fClipMode, stencilBits); | 1133 this->adjustStencilParams(settings, fClipMode, stencilBits); |
1104 } | 1134 } |
1105 } | 1135 } |
OLD | NEW |