Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Unified Diff: src/gpu/GrClipMaskManager.cpp

Issue 938383004: Dynamically create stencil buffer when needed. (Closed) Base URL: https://skia.googlesource.com/skia.git@bigstencil
Patch Set: Actually save file before uploading Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/SkXfermodeImageFilter.cpp ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrClipMaskManager.cpp
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index f69c8717f8e050521e0602ce10347e070eb8e14b..10414b5f2b4f8ecfc531313b330d97c337db4088 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -13,6 +13,7 @@
#include "GrPaint.h"
#include "GrPathRenderer.h"
#include "GrRenderTarget.h"
+#include "GrRenderTargetPriv.h"
#include "GrStencilBuffer.h"
#include "GrSWMaskHelper.h"
#include "SkRasterClip.h"
@@ -675,8 +676,7 @@ bool GrClipMaskManager::createStencilClipMask(GrRenderTarget* rt,
SkASSERT(kNone_ClipMaskType == fCurrClipMaskType);
SkASSERT(rt);
- // TODO: dynamically attach a SB when needed.
- GrStencilBuffer* stencilBuffer = rt->getStencilBuffer();
+ GrStencilBuffer* stencilBuffer = rt->renderTargetPriv().attachStencilBuffer();
if (NULL == stencilBuffer) {
return false;
}
@@ -905,9 +905,9 @@ void GrClipMaskManager::setPipelineBuilderStencil(GrPipelineBuilder* pipelineBui
settings = pipelineBuilder->getStencil();
}
- // TODO: dynamically attach a stencil buffer
int stencilBits = 0;
- GrStencilBuffer* stencilBuffer = pipelineBuilder->getRenderTarget()->getStencilBuffer();
+ GrRenderTarget* rt = pipelineBuilder->getRenderTarget();
+ GrStencilBuffer* stencilBuffer = rt->renderTargetPriv().attachStencilBuffer();
if (stencilBuffer) {
stencilBits = stencilBuffer->bits();
}
@@ -1084,7 +1084,6 @@ void GrClipMaskManager::setClipTarget(GrClipTarget* clipTarget) {
void GrClipMaskManager::adjustPathStencilParams(const GrStencilBuffer* stencilBuffer,
GrStencilSettings* settings) {
- // TODO: dynamically attach a stencil buffer
if (stencilBuffer) {
int stencilBits = stencilBuffer->bits();
this->adjustStencilParams(settings, fClipMode, stencilBits);
« no previous file with comments | « src/effects/SkXfermodeImageFilter.cpp ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698