aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPaint.cpp
diff options
context:
space:
mode:
authorGravatar rmistry <rmistry@google.com>2014-06-23 06:59:15 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-06-23 06:59:15 -0700
commitc4b84aef1adeb68bc853f35abb85b79fa1fcaac6 (patch)
tree54b63d339f397610f8bde7efb17c10ce3acbbbe5 /src/core/SkPaint.cpp
parent05ead8afe5e4db21f9004334ac339bdad48d5057 (diff)
Revert of Revert of Fix SkPaint::measureText for stroked hairline text (https://codereview.chromium.org/354433002/)
Reason for revert: Rebaseline CL is ready to be submitted Original issue's description: > Revert of Fix SkPaint::measureText for stroked hairline text (https://codereview.chromium.org/335603003/) > > Reason for revert: > Caused many shadertext GM failures > > Original issue's description: > > Fix SkPaint::measureText for stroked hairline text > > > > SkPaint::measureText and text drawing used different criteria for > > determining whether text should be drawn as paths or not. > > > > Adds tests glyph_pos_(h/n)_(s/f/b) to test the text rendering and the glyph > > positioning in the rendering. Mainly added in order to define what is the > > expected text rendering when hairline stroke is used with various transform > > options. > > > > The testcase also tries to note or highlight the fact that SkPaint::measureText > > is not expected to produce intuitively matching results when compared to a > > rendering, if the rendering is done so that the device ends up having a device > > transform. > > > > This fixes the glyph_pos_h_s (hairline, stroked) test-case. > > > > Ignore shadertext2_pdf-poppler.png gm on > > Test-Ubuntu13.10-ShuttleA-NoGPU-x86_64-Debug temporarily, as that fails. > > > > Committed: https://skia.googlesource.com/skia/+/196af738027c5e18c3eb792dbcaf90ef27821793 > > TBR=jvanverth@google.com,reed@google.com,kkinnunen@nvidia.com > NOTREECHECKS=true > NOTRY=true > > Committed: https://skia.googlesource.com/skia/+/abc9bb55ddfeb4b1a7acc335a34841fddcd22d27 R=jvanverth@google.com, reed@google.com, kkinnunen@nvidia.com TBR=jvanverth@google.com, kkinnunen@nvidia.com, reed@google.com NOTREECHECKS=true NOTRY=true Author: rmistry@google.com Review URL: https://codereview.chromium.org/349153005
Diffstat (limited to 'src/core/SkPaint.cpp')
-rw-r--r--src/core/SkPaint.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 16d8bb2e4e..86b54f22c8 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -11,6 +11,7 @@
#include "SkColorFilter.h"
#include "SkData.h"
#include "SkDeviceProperties.h"
+#include "SkDraw.h"
#include "SkFontDescriptor.h"
#include "SkFontHost.h"
#include "SkGlyphCache.h"
@@ -506,15 +507,6 @@ bool SkPaint::TooBigToUseCache(const SkMatrix& ctm, const SkMatrix& textM) {
return tooBig(matrix, MaxCacheSize2());
}
-bool SkPaint::tooBigToUseCache(const SkMatrix& ctm) const {
- SkMatrix textM;
- return TooBigToUseCache(ctm, *this->setTextMatrix(&textM));
-}
-
-bool SkPaint::tooBigToUseCache() const {
- SkMatrix textM;
- return tooBig(*this->setTextMatrix(&textM), MaxCacheSize2());
-}
///////////////////////////////////////////////////////////////////////////////
@@ -997,7 +989,7 @@ SkScalar SkPaint::setupForAsPaths() {
class SkCanonicalizePaint {
public:
SkCanonicalizePaint(const SkPaint& paint) : fPaint(&paint), fScale(0) {
- if (paint.isLinearText() || paint.tooBigToUseCache()) {
+ if (paint.isLinearText() || SkDraw::ShouldDrawTextAsPaths(paint, SkMatrix::I())) {
SkPaint* p = fLazy.set(paint);
fScale = p->setupForAsPaths();
fPaint = p;