Skip to content

Commit a08bde6

Browse files
herbderbySkia Commit-Bot
authored andcommitted
GrTextContext::Options -> GrSDFTOptions
Rename GrTextContext::Options to GrSDFTOptions. Remove GrTextContext. TBR=reed@google.com Change-Id: Ic89966cfe630cc6ee757977a6d63ae1da9e39ef0 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296176 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
1 parent 92219b4 commit a08bde6

19 files changed

+94
-127
lines changed

bench/CoverageBench.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "include/core/SkPath.h"
1414
#include "src/core/SkAutoPixmapStorage.h"
1515
#include "src/core/SkDraw.h"
16+
#include "src/core/SkMatrixProvider.h"
1617
#include "src/core/SkRasterClip.h"
1718

1819
class DrawPathBench : public Benchmark {

gn/gpu.gni

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,14 +465,14 @@ skia_gpu_sources = [
465465
"$_src/gpu/text/GrDistanceFieldAdjustTable.h",
466466
"$_src/gpu/text/GrSDFMaskFilter.cpp",
467467
"$_src/gpu/text/GrSDFMaskFilter.h",
468+
"$_src/gpu/text/GrSDFTOptions.cpp",
469+
"$_src/gpu/text/GrSDFTOptions.h",
468470
"$_src/gpu/text/GrStrikeCache.cpp",
469471
"$_src/gpu/text/GrStrikeCache.h",
470472
"$_src/gpu/text/GrTextBlob.cpp",
471473
"$_src/gpu/text/GrTextBlob.h",
472474
"$_src/gpu/text/GrTextBlobCache.cpp",
473475
"$_src/gpu/text/GrTextBlobCache.h",
474-
"$_src/gpu/text/GrTextContext.cpp",
475-
"$_src/gpu/text/GrTextContext.h",
476476
"$_src/gpu/text/GrTextTarget.h",
477477

478478
# GLSL

include/gpu/GrContext.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class GrResourceProvider;
3636
class GrStrikeCache;
3737
class GrSurfaceProxy;
3838
class GrSwizzle;
39-
class GrTextContext;
4039
class GrTextureProxy;
4140
struct GrVkBackendContext;
4241

src/core/SkGlyphRunPainter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
#include "src/gpu/GrRenderTargetContext.h"
1717
#include "src/gpu/SkGr.h"
1818
#include "src/gpu/ops/GrAtlasTextOp.h"
19+
#include "src/gpu/text/GrSDFTOptions.h"
1920
#include "src/gpu/text/GrTextBlobCache.h"
20-
#include "src/gpu/text/GrTextContext.h"
2121
#endif
2222

2323
#include "include/core/SkColorFilter.h"
@@ -48,7 +48,7 @@ SkGlyphRunListPainter::SkGlyphRunListPainter(const SkSurfaceProps& props,
4848
, fColorType{colorType}, fScalerContextFlags{flags}
4949
, fStrikeCache{strikeCache} {}
5050

51-
// TODO: unify with code in GrTextContext.cpp
51+
// TODO: unify with code in GrSDFTOptions.cpp
5252
static SkScalerContextFlags compute_scaler_context_flags(const SkColorSpace* cs) {
5353
// If we're doing linear blending, then we can disable the gamma hacks.
5454
// Otherwise, leave them on. In either case, we still want the contrast boost:
@@ -141,7 +141,7 @@ void SkGlyphRunListPainter::processGlyphRunList(const SkGlyphRunList& glyphRunLi
141141
const SkMatrix& drawMatrix,
142142
const SkSurfaceProps& props,
143143
bool contextSupportsDistanceFieldText,
144-
const GrTextContext::Options& options,
144+
const GrSDFTOptions& options,
145145
SkGlyphRunPainterInterface* process) {
146146

147147
SkPoint origin = glyphRunList.origin();

src/core/SkGlyphRunPainter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "src/core/SkTextBlobPriv.h"
1717

1818
#if SK_SUPPORT_GPU
19-
#include "src/gpu/text/GrTextContext.h"
19+
#include "src/gpu/text/GrSDFTOptions.h"
2020
class GrColorInfo;
2121
class GrRenderTargetContext;
2222
#endif
@@ -87,7 +87,7 @@ class SkGlyphRunListPainter {
8787
const SkMatrix& drawMatrix,
8888
const SkSurfaceProps& props,
8989
bool contextSupportsDistanceFieldText,
90-
const GrTextContext::Options& options,
90+
const GrSDFTOptions& options,
9191
SkGlyphRunPainterInterface* process);
9292
#endif // SK_SUPPORT_GPU
9393

src/core/SkRemoteGlyphCache.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@
2828
#include "src/core/SkZip.h"
2929

3030
#if SK_SUPPORT_GPU
31+
#include "include/gpu/GrContextOptions.h"
3132
#include "src/gpu/GrDrawOpAtlas.h"
32-
#include "src/gpu/text/GrTextContext.h"
33+
#include "src/gpu/text/GrSDFTOptions.h"
3334
#endif
3435

3536
static SkDescriptor* auto_descriptor_from_desc(const SkDescriptor* source_desc,
@@ -393,7 +394,7 @@ class SkTextBlobCacheDiffCanvas::TrackLayerDevice final : public SkNoPixelsDevic
393394
void drawGlyphRunList(const SkGlyphRunList& glyphRunList) override {
394395
#if SK_SUPPORT_GPU
395396
GrContextOptions ctxOptions;
396-
GrTextContext::Options options =
397+
GrSDFTOptions options =
397398
{ctxOptions.fMinDistanceFieldFontSize, ctxOptions.fGlyphsAsPathsFontSize};
398399

399400
#ifdef SK_CAPTURE_DRAW_TEXT_BLOB

src/core/SkStrikeSpec.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
#include "src/core/SkTLazy.h"
1515

1616
#if SK_SUPPORT_GPU
17+
#include "src/gpu/text/GrSDFMaskFilter.h"
18+
#include "src/gpu/text/GrSDFTOptions.h"
1719
#include "src/gpu/text/GrStrikeCache.h"
18-
#include "src/gpu/text/GrTextContext.h"
1920
#endif
2021

2122
SkStrikeSpec SkStrikeSpec::MakeMask(const SkFont& font, const SkPaint& paint,
@@ -186,10 +187,11 @@ SkStrikeSpec SkStrikeSpec::MakePDFVector(const SkTypeface& typeface, int* size)
186187
std::tuple<SkStrikeSpec, SkScalar, SkScalar>
187188
SkStrikeSpec::MakeSDFT(const SkFont& font, const SkPaint& paint,
188189
const SkSurfaceProps& surfaceProps, const SkMatrix& deviceMatrix,
189-
const GrTextContext::Options& options) {
190+
const GrSDFTOptions& options) {
190191
SkStrikeSpec storage;
191192

192-
SkPaint dfPaint = GrTextContext::InitDistanceFieldPaint(paint);
193+
SkPaint dfPaint{paint};
194+
dfPaint.setMaskFilter(GrSDFMaskFilter::Make());
193195
SkFont dfFont = options.getSDFFont(font, deviceMatrix, &storage.fStrikeToSourceRatio);
194196

195197
// Fake-gamma and subpixel antialiasing are applied in the shader, so we ignore the

src/core/SkStrikeSpec.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "src/core/SkStrikeForGPU.h"
1414

1515
#if SK_SUPPORT_GPU
16-
#include "src/gpu/text/GrTextContext.h"
16+
#include "src/gpu/text/GrSDFTOptions.h"
1717
class GrStrikeCache;
1818
class GrTextStrike;
1919
#endif
@@ -67,7 +67,7 @@ class SkStrikeSpec {
6767
const SkPaint& paint,
6868
const SkSurfaceProps& surfaceProps,
6969
const SkMatrix& deviceMatrix,
70-
const GrTextContext::Options& options);
70+
const GrSDFTOptions& options);
7171

7272
sk_sp<GrTextStrike> findOrCreateGrStrike(GrStrikeCache* cache) const;
7373
#endif

src/gpu/GrContext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
#include "src/gpu/SkGr.h"
3131
#include "src/gpu/ccpr/GrCoverageCountingPathRenderer.h"
3232
#include "src/gpu/effects/GrSkSLFP.h"
33+
#include "src/gpu/text/GrSDFTOptions.h"
3334
#include "src/gpu/text/GrStrikeCache.h"
3435
#include "src/gpu/text/GrTextBlobCache.h"
35-
#include "src/gpu/text/GrTextContext.h"
3636
#include "src/image/SkImage_GpuBase.h"
3737
#include "src/image/SkSurface_Gpu.h"
3838
#include <atomic>

src/gpu/GrDrawingManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#include "src/gpu/GrTransferFromRenderTask.h"
3838
#include "src/gpu/GrWaitRenderTask.h"
3939
#include "src/gpu/ccpr/GrCoverageCountingPathRenderer.h"
40-
#include "src/gpu/text/GrTextContext.h"
40+
#include "src/gpu/text/GrSDFTOptions.h"
4141
#include "src/image/SkSurface_Gpu.h"
4242

4343
GrDrawingManager::RenderTaskDAG::RenderTaskDAG(bool sortRenderTasks)

0 commit comments

Comments
 (0)