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

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

Issue 703463002: Improve quality of distance field rendering (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Ignore GMs 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 unified diff | Download patch
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrAADistanceFieldPathRenderer.h" 9 #include "GrAADistanceFieldPathRenderer.h"
10 10
(...skipping 19 matching lines...) Expand all
30 SK_CONF_DECLARE(bool, c_DumpPathCache, "gpu.dumpPathCache", false, 30 SK_CONF_DECLARE(bool, c_DumpPathCache, "gpu.dumpPathCache", false,
31 "Dump the contents of the path cache before every purge."); 31 "Dump the contents of the path cache before every purge.");
32 32
33 #ifdef DF_PATH_TRACKING 33 #ifdef DF_PATH_TRACKING
34 static int g_NumCachedPaths = 0; 34 static int g_NumCachedPaths = 0;
35 static int g_NumFreedPaths = 0; 35 static int g_NumFreedPaths = 0;
36 #endif 36 #endif
37 37
38 // mip levels 38 // mip levels
39 static const int kSmallMIP = 32; 39 static const int kSmallMIP = 32;
40 static const int kMediumMIP = 64; 40 static const int kMediumMIP = 78;
41 static const int kLargeMIP = 128; 41 static const int kLargeMIP = 192;
42 42
43 //////////////////////////////////////////////////////////////////////////////// 43 ////////////////////////////////////////////////////////////////////////////////
44 GrAADistanceFieldPathRenderer::GrAADistanceFieldPathRenderer(GrContext* context) 44 GrAADistanceFieldPathRenderer::GrAADistanceFieldPathRenderer(GrContext* context)
45 : fContext(context) 45 : fContext(context)
46 , fAtlas(NULL) 46 , fAtlas(NULL)
47 , fEffectFlags(kInvalid_DistanceFieldEffectFlag) { 47 , fEffectFlags(kInvalid_DistanceFieldEffectFlag) {
48 } 48 }
49 49
50 GrAADistanceFieldPathRenderer::~GrAADistanceFieldPathRenderer() { 50 GrAADistanceFieldPathRenderer::~GrAADistanceFieldPathRenderer() {
51 PathDataList::Iter iter; 51 PathDataList::Iter iter;
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 drawState->setGeometryProcessor(fCachedGeometryProcessor.get()); 374 drawState->setGeometryProcessor(fCachedGeometryProcessor.get());
375 375
376 vm.mapRect(&r); 376 vm.mapRect(&r);
377 target->setIndexSourceToBuffer(fContext->getQuadIndexBuffer()); 377 target->setIndexSourceToBuffer(fContext->getQuadIndexBuffer());
378 target->drawIndexedInstances(kTriangles_GrPrimitiveType, 1, 4, 6, &r); 378 target->drawIndexedInstances(kTriangles_GrPrimitiveType, 1, 4, 6, &r);
379 target->resetVertexSource(); 379 target->resetVertexSource();
380 380
381 return true; 381 return true;
382 } 382 }
383 383
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698