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

Unified Diff: src/gpu/GrSWMaskHelper.cpp

Issue 23609026: Don't reuse scratch textures update (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Cleaned up Created 7 years, 3 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/GrInOrderDrawBuffer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrSWMaskHelper.cpp
===================================================================
--- src/gpu/GrSWMaskHelper.cpp (revision 11197)
+++ src/gpu/GrSWMaskHelper.cpp (working copy)
@@ -7,6 +7,7 @@
#include "GrSWMaskHelper.h"
#include "GrDrawState.h"
+#include "GrDrawTargetCaps.h"
#include "GrGpu.h"
#include "SkStrokeRec.h"
@@ -133,9 +134,14 @@
void GrSWMaskHelper::toTexture(GrTexture *texture) {
SkAutoLockPixels alp(fBM);
+ // If we aren't reusing scratch textures we don't need to flush before
+ // writing since no one else will be using 'texture'
+ bool reuseScratch = fContext->getGpu()->caps()->reuseScratchTextures();
+
texture->writePixels(0, 0, fBM.width(), fBM.height(),
kAlpha_8_GrPixelConfig,
- fBM.getPixels(), fBM.rowBytes());
+ fBM.getPixels(), fBM.rowBytes(),
+ reuseScratch ? 0 : GrContext::kDontFlush_PixelOpsFlag);
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698