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

Side by Side Diff: src/gpu/GrAtlasTextContext.cpp

Issue 1404473003: Add passthrough GP for cases where no color or coverage should be emitted by GP (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include "GrAtlasTextContext.h" 7 #include "GrAtlasTextContext.h"
8 8
9 #include "GrBatchFontCache.h" 9 #include "GrBatchFontCache.h"
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 1563 matching lines...) Expand 10 before | Expand all | Expand 10 after
1574 bool usesDistanceFields = this->usesDistanceFields(); 1574 bool usesDistanceFields = this->usesDistanceFields();
1575 GrMaskFormat maskFormat = this->maskFormat(); 1575 GrMaskFormat maskFormat = this->maskFormat();
1576 bool isLCD = this->isLCD(); 1576 bool isLCD = this->isLCD();
1577 1577
1578 SkAutoTUnref<const GrGeometryProcessor> gp; 1578 SkAutoTUnref<const GrGeometryProcessor> gp;
1579 if (usesDistanceFields) { 1579 if (usesDistanceFields) {
1580 gp.reset(this->setupDfProcessor(this->viewMatrix(), fFilteredColor, this->color(), 1580 gp.reset(this->setupDfProcessor(this->viewMatrix(), fFilteredColor, this->color(),
1581 texture)); 1581 texture));
1582 } else { 1582 } else {
1583 GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::k None_FilterMode); 1583 GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::k None_FilterMode);
1584 gp.reset(GrBitmapTextGeoProc::Create(this->color(), 1584 if ((maskFormat == kARGB_GrMaskFormat && fBatch.fColorIgnored)) {
1585 texture, 1585 gp.reset(GrGeometryProcessor::CreatePassthroughGP(kColorTextVASi ze));
1586 params, 1586 } else {
1587 maskFormat, 1587 gp.reset(GrBitmapTextGeoProc::Create(this->color(),
1588 localMatrix, 1588 texture,
1589 this->usesLocalCoords())); 1589 params,
1590 maskFormat,
1591 localMatrix,
1592 this->usesLocalCoords()));
1593 }
1590 } 1594 }
1591 1595
1592 FlushInfo flushInfo; 1596 FlushInfo flushInfo;
1593 flushInfo.fGlyphsToFlush = 0; 1597 flushInfo.fGlyphsToFlush = 0;
1594 size_t vertexStride = gp->getVertexStride(); 1598 size_t vertexStride = gp->getVertexStride();
1595 SkASSERT(vertexStride == (usesDistanceFields ? 1599 SkASSERT(vertexStride == (usesDistanceFields ?
1596 get_vertex_stride_df(maskFormat, isLCD) : 1600 get_vertex_stride_df(maskFormat, isLCD) :
1597 get_vertex_stride(maskFormat))); 1601 get_vertex_stride(maskFormat)));
1598 1602
1599 target->initDraw(gp, this->pipeline()); 1603 target->initDraw(gp, this->pipeline());
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after
2282 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat rix, text, 2286 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat rix, text,
2283 static_cast<size_t>(textLen), 0, 0, noClip)); 2287 static_cast<size_t>(textLen), 0, 0, noClip));
2284 2288
2285 SkScalar transX = static_cast<SkScalar>(random->nextU()); 2289 SkScalar transX = static_cast<SkScalar>(random->nextU());
2286 SkScalar transY = static_cast<SkScalar>(random->nextU()); 2290 SkScalar transY = static_cast<SkScalar>(random->nextU());
2287 const GrAtlasTextBlob::Run::SubRunInfo& info = blob->fRuns[0].fSubRunInfo[0] ; 2291 const GrAtlasTextBlob::Run::SubRunInfo& info = blob->fRuns[0].fSubRunInfo[0] ;
2288 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t ransY, skPaint); 2292 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t ransY, skPaint);
2289 } 2293 }
2290 2294
2291 #endif 2295 #endif
OLDNEW
« no previous file with comments | « gyp/gpu.gypi ('k') | src/gpu/GrGeometryProcessor.h » ('j') | src/gpu/GrGeometryProcessor.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698