aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-19 18:13:02 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-19 18:13:02 +0000
commitd92cf2ebbfbb9d737ea4a551e64ffccb08376875 (patch)
tree2fc8779ab6ebaedd66e1bdd0b80d0ad05e516fc5 /src/gpu
parent05b7bef01d42c727f5b2b065da7acc1ba75f1d3e (diff)
Fix texture allocation in SWMaskHelper
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrClipMaskManager.cpp2
-rw-r--r--src/gpu/GrGpu.cpp1
-rw-r--r--src/gpu/GrSWMaskHelper.cpp17
-rw-r--r--src/gpu/GrSWMaskHelper.h3
4 files changed, 5 insertions, 18 deletions
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index faeac27c94..7465283c38 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -993,7 +993,7 @@ GrTexture* GrClipMaskManager::createSoftwareClipMask(int32_t clipStackGenID,
}
}
- helper.toTexture(result, kAllIn_InitialState == initialState ? 0xFF : 0x00);
+ helper.toTexture(result);
fCurrClipMaskType = kAlpha_ClipMaskType;
return result;
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index c4d8318ca1..9564a50f94 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -211,6 +211,7 @@ void GrGpu::clear(const SkIRect* rect,
art.set(this->drawState(), renderTarget);
}
if (NULL == this->getDrawState().getRenderTarget()) {
+ GrAssert(0);
return;
}
this->handleDirtyContext();
diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp
index 3f9251c394..eb5c555a1f 100644
--- a/src/gpu/GrSWMaskHelper.cpp
+++ b/src/gpu/GrSWMaskHelper.cpp
@@ -130,22 +130,9 @@ bool GrSWMaskHelper::getTexture(GrAutoScratchTexture* texture) {
/**
* Move the result of the software mask generation back to the gpu
*/
-void GrSWMaskHelper::toTexture(GrTexture *texture, uint8_t alpha) {
+void GrSWMaskHelper::toTexture(GrTexture *texture) {
SkAutoLockPixels alp(fBM);
- // The destination texture is almost always larger than "fBM". Clear
- // it appropriately so we don't get mask artifacts outside of the path's
- // bounding box
-
- // "texture" needs to be installed as the render target for the clear
- // and the texture upload but cannot remain the render target upon
- // return. Callers typically use it as a texture and it would then
- // be both source and dest.
- GrDrawState::AutoRenderTargetRestore artr(fContext->getGpu()->drawState(),
- texture->asRenderTarget());
-
- fContext->getGpu()->clear(NULL, GrColorPackRGBA(alpha, alpha, alpha, alpha));
-
texture->writePixels(0, 0, fBM.width(), fBM.height(),
kAlpha_8_GrPixelConfig,
fBM.getPixels(), fBM.rowBytes());
@@ -177,7 +164,7 @@ GrTexture* GrSWMaskHelper::DrawPathMaskToTexture(GrContext* context,
return NULL;
}
- helper.toTexture(ast.texture(), 0x00);
+ helper.toTexture(ast.texture());
return ast.detach();
}
diff --git a/src/gpu/GrSWMaskHelper.h b/src/gpu/GrSWMaskHelper.h
index ce5ae28a04..fab5eeb4a0 100644
--- a/src/gpu/GrSWMaskHelper.h
+++ b/src/gpu/GrSWMaskHelper.h
@@ -63,8 +63,7 @@ public:
bool getTexture(GrAutoScratchTexture* texture);
// Move the mask generation results from the internal bitmap to the gpu.
- // The space outside of the mask is cleared using "alpha"
- void toTexture(GrTexture* texture, uint8_t alpha);
+ void toTexture(GrTexture* texture);
// Reset the internal bitmap
void clear(uint8_t alpha) {