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

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

Issue 1110993002: Revert of removing equality / compute invariant loops from GrGeometryProcessors (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanup1
Patch Set: Created 5 years, 7 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
« no previous file with comments | « src/gpu/GrAARectRenderer.cpp ('k') | src/gpu/GrDefaultGeoProcFactory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "GrBatch.h" 9 #include "GrBatch.h"
10 #include "GrBatchFontCache.h" 10 #include "GrBatchFontCache.h"
(...skipping 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after
1486 SkDebugf("Could not allocate backing texture for atlas\n"); 1486 SkDebugf("Could not allocate backing texture for atlas\n");
1487 return; 1487 return;
1488 } 1488 }
1489 1489
1490 SkAutoTUnref<const GrGeometryProcessor> gp; 1490 SkAutoTUnref<const GrGeometryProcessor> gp;
1491 if (fUseDistanceFields) { 1491 if (fUseDistanceFields) {
1492 gp.reset(this->setupDfProcessor(this->viewMatrix(), fFilteredColor, this->color(), 1492 gp.reset(this->setupDfProcessor(this->viewMatrix(), fFilteredColor, this->color(),
1493 texture)); 1493 texture));
1494 } else { 1494 } else {
1495 GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::k None_FilterMode); 1495 GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::k None_FilterMode);
1496
1497 // This will be ignored in the non A8 case
1498 bool opaqueVertexColors = GrColorIsOpaque(this->color());
1496 gp.reset(GrBitmapTextGeoProc::Create(this->color(), 1499 gp.reset(GrBitmapTextGeoProc::Create(this->color(),
1497 texture, 1500 texture,
1498 params, 1501 params,
1499 fMaskFormat, 1502 fMaskFormat,
1503 opaqueVertexColors,
1500 localMatrix)); 1504 localMatrix));
1501 } 1505 }
1502 1506
1503 size_t vertexStride = gp->getVertexStride(); 1507 size_t vertexStride = gp->getVertexStride();
1504 SkASSERT(vertexStride == (fUseDistanceFields ? 1508 SkASSERT(vertexStride == (fUseDistanceFields ?
1505 get_vertex_stride_df(fMaskFormat, fUseLCDText) : 1509 get_vertex_stride_df(fMaskFormat, fUseLCDText) :
1506 get_vertex_stride(fMaskFormat))); 1510 get_vertex_stride(fMaskFormat)));
1507 1511
1508 this->initDraw(batchTarget, gp, pipeline); 1512 this->initDraw(batchTarget, gp, pipeline);
1509 1513
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
1952 blueCorrecti on); 1956 blueCorrecti on);
1953 1957
1954 return GrDistanceFieldLCDTextGeoProc::Create(color, 1958 return GrDistanceFieldLCDTextGeoProc::Create(color,
1955 viewMatrix, 1959 viewMatrix,
1956 texture, 1960 texture,
1957 params, 1961 params,
1958 widthAdjust, 1962 widthAdjust,
1959 flags); 1963 flags);
1960 } else { 1964 } else {
1961 flags |= kColorAttr_DistanceFieldEffectFlag; 1965 flags |= kColorAttr_DistanceFieldEffectFlag;
1966 bool opaque = GrColorIsOpaque(color);
1962 #ifdef SK_GAMMA_APPLY_TO_A8 1967 #ifdef SK_GAMMA_APPLY_TO_A8
1963 U8CPU lum = SkColorSpaceLuminance::computeLuminance(fGamma, filtered Color); 1968 U8CPU lum = SkColorSpaceLuminance::computeLuminance(fGamma, filtered Color);
1964 float correction = (*fDistanceAdjustTable)[lum >> kDistanceAdjustLum Shift]; 1969 float correction = (*fDistanceAdjustTable)[lum >> kDistanceAdjustLum Shift];
1965 return GrDistanceFieldA8TextGeoProc::Create(color, 1970 return GrDistanceFieldA8TextGeoProc::Create(color,
1966 viewMatrix, 1971 viewMatrix,
1967 texture, 1972 texture,
1968 params, 1973 params,
1969 correction, 1974 correction,
1970 flags); 1975 flags,
1976 opaque);
1971 #else 1977 #else
1972 return GrDistanceFieldA8TextGeoProc::Create(color, 1978 return GrDistanceFieldA8TextGeoProc::Create(color,
1973 viewMatrix, 1979 viewMatrix,
1974 texture, 1980 texture,
1975 params, 1981 params,
1976 flags); 1982 flags,
1983 opaque);
1977 #endif 1984 #endif
1978 } 1985 }
1979 1986
1980 } 1987 }
1981 1988
1982 struct BatchTracker { 1989 struct BatchTracker {
1983 GrColor fColor; 1990 GrColor fColor;
1984 SkMatrix fViewMatrix; 1991 SkMatrix fViewMatrix;
1985 bool fUsesLocalCoords; 1992 bool fUsesLocalCoords;
1986 bool fColorIgnored; 1993 bool fColorIgnored;
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
2148 pipelineBuilder.setFromPaint(grPaint, rt, clip); 2155 pipelineBuilder.setFromPaint(grPaint, rt, clip);
2149 2156
2150 GrColor color = grPaint.getColor(); 2157 GrColor color = grPaint.getColor();
2151 for (int run = 0; run < cacheBlob->fRunCount; run++) { 2158 for (int run = 0; run < cacheBlob->fRunCount; run++) {
2152 this->flushRun(target, &pipelineBuilder, cacheBlob, run, color, 0, 0, sk Paint); 2159 this->flushRun(target, &pipelineBuilder, cacheBlob, run, color, 0, 0, sk Paint);
2153 } 2160 }
2154 2161
2155 // Now flush big glyphs 2162 // Now flush big glyphs
2156 this->flushBigGlyphs(cacheBlob, rt, grPaint, clip, 0, 0); 2163 this->flushBigGlyphs(cacheBlob, rt, grPaint, clip, 0, 0);
2157 } 2164 }
OLDNEW
« no previous file with comments | « src/gpu/GrAARectRenderer.cpp ('k') | src/gpu/GrDefaultGeoProcFactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698