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

Unified Diff: src/gpu/GrBitmapTextContext.cpp

Issue 715903002: Push creation of default GP to the caller (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: added comment Created 6 years, 1 month 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/GrAARectRenderer.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/GrBitmapTextContext.cpp
diff --git a/src/gpu/GrBitmapTextContext.cpp b/src/gpu/GrBitmapTextContext.cpp
index 41dc784e791493d1ac693f5558252736e04d0bb0..50fe9ca13301beb7af7d6a5609160d5b2613249a 100755
--- a/src/gpu/GrBitmapTextContext.cpp
+++ b/src/gpu/GrBitmapTextContext.cpp
@@ -7,6 +7,7 @@
#include "GrBitmapTextContext.h"
#include "GrAtlas.h"
+#include "GrDefaultGeoProcFactory.h"
#include "GrDrawTarget.h"
#include "GrFontScaler.h"
#include "GrIndexBuffer.h"
@@ -14,8 +15,6 @@
#include "GrTexturePriv.h"
#include "GrTextStrike.h"
#include "GrTextStrike_impl.h"
-#include "effects/GrCustomCoordsTextureEffect.h"
-#include "effects/GrSimpleTextureEffect.h"
#include "SkAutoKern.h"
#include "SkColorPriv.h"
@@ -29,6 +28,9 @@
#include "SkStrokeRec.h"
#include "SkTextMapStateProc.h"
+#include "effects/GrCustomCoordsTextureEffect.h"
+#include "effects/GrSimpleTextureEffect.h"
+
SK_CONF_DECLARE(bool, c_DumpFontCache, "gpu.dumpFontCache", false,
"Dump the contents of the font cache before every purge.");
@@ -42,11 +44,6 @@ extern const GrVertexAttrib gLCDVertexAttribs[] = {
static const size_t kLCDTextVASize = 2 * sizeof(SkPoint);
// position + local coord
-extern const GrVertexAttrib gColorVertexAttribs[] = {
- {kVec2f_GrVertexAttribType, 0, kPosition_GrVertexAttribBinding},
- {kVec2f_GrVertexAttribType, sizeof(SkPoint), kLocalCoord_GrVertexAttribBinding}
-};
-
static const size_t kColorTextVASize = 2 * sizeof(SkPoint);
// position + color + texture coord
@@ -360,8 +357,8 @@ static void* alloc_vertices(GrDrawTarget* drawTarget, int numVertices, GrMaskFor
drawTarget->drawState()->setVertexAttribs<gGrayVertexAttribs>(
SK_ARRAY_COUNT(gGrayVertexAttribs), kGrayTextVASize);
} else if (kARGB_GrMaskFormat == maskFormat) {
- drawTarget->drawState()->setVertexAttribs<gColorVertexAttribs>(
- SK_ARRAY_COUNT(gColorVertexAttribs), kColorTextVASize);
+ GrDefaultGeoProcFactory::SetAttribs(drawTarget->drawState(),
+ GrDefaultGeoProcFactory::kLocalCoord_GPType);
} else {
drawTarget->drawState()->setVertexAttribs<gLCDVertexAttribs>(
SK_ARRAY_COUNT(gLCDVertexAttribs), kLCDTextVASize);
@@ -564,6 +561,7 @@ void GrBitmapTextContext::flush() {
// This effect could be stored with one of the cache objects (atlas?)
if (kARGB_GrMaskFormat == fCurrMaskFormat) {
+ drawState->setGeometryProcessor(GrDefaultGeoProcFactory::Create(true))->unref();
GrFragmentProcessor* fragProcessor = GrSimpleTextureEffect::Create(fCurrTexture,
SkMatrix::I(),
params);
« no previous file with comments | « src/gpu/GrAARectRenderer.cpp ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698