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

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

Issue 986333005: Revert of Adjust distance field glyph and font atlas sizes to maximize storage. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | src/gpu/GrFontAtlasSizes.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 2013 Google Inc. 2 * Copyright 2013 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 7
8 #include "GrDistanceFieldTextContext.h" 8 #include "GrDistanceFieldTextContext.h"
9 #include "GrAtlas.h" 9 #include "GrAtlas.h"
10 #include "GrBitmapTextContext.h" 10 #include "GrBitmapTextContext.h"
11 #include "GrDrawTarget.h" 11 #include "GrDrawTarget.h"
12 #include "GrDrawTargetCaps.h" 12 #include "GrDrawTargetCaps.h"
13 #include "GrFontAtlasSizes.h"
14 #include "GrFontCache.h" 13 #include "GrFontCache.h"
15 #include "GrFontScaler.h" 14 #include "GrFontScaler.h"
16 #include "GrGpu.h" 15 #include "GrGpu.h"
17 #include "GrIndexBuffer.h" 16 #include "GrIndexBuffer.h"
18 #include "GrStrokeInfo.h" 17 #include "GrStrokeInfo.h"
19 #include "GrTexturePriv.h" 18 #include "GrTexturePriv.h"
20 19
21 #include "SkAutoKern.h" 20 #include "SkAutoKern.h"
22 #include "SkColorFilter.h" 21 #include "SkColorFilter.h"
23 #include "SkDistanceFieldGen.h" 22 #include "SkDistanceFieldGen.h"
24 #include "SkDraw.h" 23 #include "SkDraw.h"
25 #include "SkGlyphCache.h" 24 #include "SkGlyphCache.h"
26 #include "SkGpuDevice.h" 25 #include "SkGpuDevice.h"
27 #include "SkPath.h" 26 #include "SkPath.h"
28 #include "SkRTConf.h" 27 #include "SkRTConf.h"
29 #include "SkStrokeRec.h" 28 #include "SkStrokeRec.h"
30 #include "effects/GrDistanceFieldTextureEffect.h" 29 #include "effects/GrDistanceFieldTextureEffect.h"
31 30
32 SK_CONF_DECLARE(bool, c_DumpFontCache, "gpu.dumpFontCache", false, 31 SK_CONF_DECLARE(bool, c_DumpFontCache, "gpu.dumpFontCache", false,
33 "Dump the contents of the font cache before every purge."); 32 "Dump the contents of the font cache before every purge.");
34 33
35 static const int kSmallDFFontSize = 32; 34 static const int kSmallDFFontSize = 32;
36 static const int kSmallDFFontLimit = 32; 35 static const int kSmallDFFontLimit = 32;
37 static const int kMediumDFFontSize = 70; 36 static const int kMediumDFFontSize = 78;
38 static const int kMediumDFFontLimit = 70; 37 static const int kMediumDFFontLimit = 78;
39 static const int kLargeDFFontSize = 156; 38 static const int kLargeDFFontSize = 192;
40 SK_COMPILE_ASSERT(GR_SDF_MAX_SIZE >= kLargeDFFontSize, sdf_too_big);
41 39
42 static const int kVerticesPerGlyph = 4; 40 static const int kVerticesPerGlyph = 4;
43 static const int kIndicesPerGlyph = 6; 41 static const int kIndicesPerGlyph = 6;
44 42
45 GrDistanceFieldTextContext::GrDistanceFieldTextContext(GrContext* context, 43 GrDistanceFieldTextContext::GrDistanceFieldTextContext(GrContext* context,
46 const SkDeviceProperties& properties, 44 const SkDeviceProperties& properties,
47 bool enable) 45 bool enable)
48 : GrTextContext(context, pro perties) { 46 : GrTextContext(context, pro perties) {
49 #if SK_FORCE_DISTANCE_FIELD_TEXT 47 #if SK_FORCE_DISTANCE_FIELD_TEXT
50 fEnableDFRendering = true; 48 fEnableDFRendering = true;
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 } 717 }
720 } 718 }
721 719
722 inline void GrDistanceFieldTextContext::finish() { 720 inline void GrDistanceFieldTextContext::finish() {
723 this->flush(); 721 this->flush();
724 fTotalVertexCount = 0; 722 fTotalVertexCount = 0;
725 723
726 GrTextContext::finish(); 724 GrTextContext::finish();
727 } 725 }
728 726
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrFontAtlasSizes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698