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

Unified Diff: src/gpu/GrSWMaskHelper.cpp

Issue 1225923010: Refugee from Dead Machine 4: MDB Monster Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Last update from dead machine Created 4 years, 8 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/gpu/GrResourceCache.cpp ('k') | src/gpu/GrStencilAndCoverTextContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrSWMaskHelper.cpp
diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp
index 6692e3d8333e503e4add7839ad1721efe562b889..a2588d0f47a3f479e48a054e4fe1e2486b0a52ef 100644
--- a/src/gpu/GrSWMaskHelper.cpp
+++ b/src/gpu/GrSWMaskHelper.cpp
@@ -226,6 +226,9 @@ bool GrSWMaskHelper::init(const SkIRect& resultBounds,
return true;
}
+#include "GrContext.h"
+#include "GrResourceProvider.h"
+
/**
* Get a texture (from the texture cache) of the correct size & format.
*/
@@ -248,7 +251,7 @@ GrTexture* GrSWMaskHelper::createTexture() {
SkASSERT(fContext->caps()->isConfigTexturable(desc.fConfig));
}
- return fContext->textureProvider()->createApproxTexture(desc);
+ return fContext->resourceProvider()->createApproxTexture(desc, GrResourceProvider::kNoPendingIO_Flag);
}
void GrSWMaskHelper::sendTextureData(GrTexture *texture, const GrSurfaceDesc& desc,
@@ -261,9 +264,12 @@ void GrSWMaskHelper::sendTextureData(GrTexture *texture, const GrSurfaceDesc& de
// have a render target.
SkASSERT(nullptr == texture->asRenderTarget());
- texture->writePixels(0, 0, desc.fWidth, desc.fHeight,
+ texture->writePixels(NULL, 0, 0, desc.fWidth, desc.fHeight,
desc.fConfig, data, rowbytes,
reuseScratch ? 0 : GrContext::kDontFlush_PixelOpsFlag);
+
+ texture->setFromRawPixels(true);
+ texture->setException(true);
}
void GrSWMaskHelper::compressTextureData(GrTexture *texture, const GrSurfaceDesc& desc) {
@@ -337,6 +343,8 @@ GrTexture* GrSWMaskHelper::DrawPathMaskToTexture(GrContext* context,
return nullptr;
}
+
+
helper.toTexture(texture);
return texture;
@@ -370,7 +378,7 @@ void GrSWMaskHelper::DrawToTargetWithPathMask(GrTexture* texture,
GrSimpleTextureEffect::Create(texture,
maskMatrix,
GrTextureParams::kNone_FilterMode,
- kDevice_GrCoordSet))->unref();
+ kDevice_GrCoordSet, target->rt_delete_me()))->unref();
target->drawNonAARect(*pipelineBuilder, color, SkMatrix::I(), dstRect, invert);
}
« no previous file with comments | « src/gpu/GrResourceCache.cpp ('k') | src/gpu/GrStencilAndCoverTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698