Nobody defines SK_SUPPORT_HINTING_SCALE_FACTOR any more, so remove it.
I left the dummy value in the flattened paint. I'm hoping to do an overhaul of the paint serialization format which will need a picture version bump anyway, so it can all go together. If that doesn't pan out we can remove this on its own later. BUG= R=reed@google.com Review URL: https://codereview.chromium.org/23056005 git-svn-id: http://skia.googlecode.com/svn/trunk@10757 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
cb8b0eeacf
commit
2822c9a92b
@ -3,7 +3,6 @@
|
||||
{
|
||||
'defines': [
|
||||
'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=<(skia_static_initializers)',
|
||||
# 'SK_SUPPORT_HINTING_SCALE_FACTOR',
|
||||
],
|
||||
'conditions' : [
|
||||
[ 'skia_gpu == 1',
|
||||
|
@ -717,20 +717,6 @@ public:
|
||||
*/
|
||||
void setTextSkewX(SkScalar skewX);
|
||||
|
||||
#ifdef SK_SUPPORT_HINTING_SCALE_FACTOR
|
||||
/** Return the paint's scale factor used for correctly rendering
|
||||
glyphs in high DPI mode without text subpixel positioning.
|
||||
@return the scale factor used for rendering glyphs in high DPI mode.
|
||||
*/
|
||||
SkScalar getHintingScaleFactor() const { return fHintingScaleFactor; }
|
||||
|
||||
/** Set the paint's scale factor used for correctly rendering
|
||||
glyphs in high DPI mode without text subpixel positioning.
|
||||
@param the scale factor used for rendering glyphs in high DPI mode.
|
||||
*/
|
||||
void setHintingScaleFactor(SkScalar hintingScaleFactor);
|
||||
#endif
|
||||
|
||||
/** Describes how to interpret the text parameters that are passed to paint
|
||||
methods like measureText() and getTextWidths().
|
||||
*/
|
||||
@ -998,9 +984,6 @@ private:
|
||||
SkScalar fTextSize;
|
||||
SkScalar fTextScaleX;
|
||||
SkScalar fTextSkewX;
|
||||
#ifdef SK_SUPPORT_HINTING_SCALE_FACTOR
|
||||
SkScalar fHintingScaleFactor;
|
||||
#endif
|
||||
|
||||
SkPathEffect* fPathEffect;
|
||||
SkShader* fShader;
|
||||
|
@ -70,9 +70,6 @@ SkPaint::SkPaint() {
|
||||
|
||||
fTextSize = SkPaintDefaults_TextSize;
|
||||
fTextScaleX = SK_Scalar1;
|
||||
#ifdef SK_SUPPORT_HINTING_SCALE_FACTOR
|
||||
fHintingScaleFactor = SK_Scalar1;
|
||||
#endif
|
||||
fColor = SK_ColorBLACK;
|
||||
fMiterLimit = SkPaintDefaults_MiterLimit;
|
||||
fFlags = SkPaintDefaults_Flags;
|
||||
@ -389,13 +386,6 @@ void SkPaint::setTextSkewX(SkScalar skewX) {
|
||||
fTextSkewX = skewX;
|
||||
}
|
||||
|
||||
#ifdef SK_SUPPORT_HINTING_SCALE_FACTOR
|
||||
void SkPaint::setHintingScaleFactor(SkScalar hintingScaleFactor) {
|
||||
GEN_ID_INC_EVAL(hintingScaleFactor != fHintingScaleFactor);
|
||||
fHintingScaleFactor = hintingScaleFactor;
|
||||
}
|
||||
#endif
|
||||
|
||||
void SkPaint::setTextEncoding(TextEncoding encoding) {
|
||||
if ((unsigned)encoding <= kGlyphID_TextEncoding) {
|
||||
GEN_ID_INC_EVAL((unsigned)encoding != fTextEncoding);
|
||||
@ -1594,9 +1584,6 @@ void SkScalerContext::MakeRec(const SkPaint& paint,
|
||||
rec->fTextSize = paint.getTextSize();
|
||||
rec->fPreScaleX = paint.getTextScaleX();
|
||||
rec->fPreSkewX = paint.getTextSkewX();
|
||||
#ifdef SK_SUPPORT_HINTING_SCALE_FACTOR
|
||||
rec->fHintingScaleFactor = paint.getHintingScaleFactor();
|
||||
#endif
|
||||
|
||||
if (deviceMatrix) {
|
||||
rec->fPost2x2[0][0] = sk_relax(deviceMatrix->getScaleX());
|
||||
@ -2058,12 +2045,8 @@ void SkPaint::flatten(SkFlattenableWriteBuffer& buffer) const {
|
||||
ptr = write_scalar(ptr, this->getTextSize());
|
||||
ptr = write_scalar(ptr, this->getTextScaleX());
|
||||
ptr = write_scalar(ptr, this->getTextSkewX());
|
||||
#ifdef SK_SUPPORT_HINTING_SCALE_FACTOR
|
||||
ptr = write_scalar(ptr, this->getHintingScaleFactor());
|
||||
#else
|
||||
// Dummy value.
|
||||
// Dummy value for obsolete hinting scale factor. TODO: remove with next picture version
|
||||
ptr = write_scalar(ptr, SK_Scalar1);
|
||||
#endif
|
||||
ptr = write_scalar(ptr, this->getStrokeWidth());
|
||||
ptr = write_scalar(ptr, this->getStrokeMiter());
|
||||
*ptr++ = this->getColor();
|
||||
@ -2080,12 +2063,8 @@ void SkPaint::flatten(SkFlattenableWriteBuffer& buffer) const {
|
||||
buffer.writeScalar(fTextSize);
|
||||
buffer.writeScalar(fTextScaleX);
|
||||
buffer.writeScalar(fTextSkewX);
|
||||
#ifdef SK_SUPPORT_HINTING_SCALE_FACTOR
|
||||
buffer.writeScalar(fHintingScaleFactor);
|
||||
#else
|
||||
// Dummy value.
|
||||
// Dummy value for obsolete hinting scale factor. TODO: remove with next picture version
|
||||
buffer.writeScalar(SK_Scalar1);
|
||||
#endif
|
||||
buffer.writeScalar(fWidth);
|
||||
buffer.writeScalar(fMiterLimit);
|
||||
buffer.writeColor(fColor);
|
||||
@ -2131,12 +2110,8 @@ void SkPaint::unflatten(SkFlattenableReadBuffer& buffer) {
|
||||
this->setTextSize(read_scalar(pod));
|
||||
this->setTextScaleX(read_scalar(pod));
|
||||
this->setTextSkewX(read_scalar(pod));
|
||||
#ifdef SK_SUPPORT_HINTING_SCALE_FACTOR
|
||||
this->setHintingScaleFactor(read_scalar(pod));
|
||||
#else
|
||||
// Skip the hinting scalar factor, which is not supported.
|
||||
read_scalar(pod);
|
||||
#endif
|
||||
this->setStrokeWidth(read_scalar(pod));
|
||||
this->setStrokeMiter(read_scalar(pod));
|
||||
this->setColor(*pod++);
|
||||
@ -2163,12 +2138,8 @@ void SkPaint::unflatten(SkFlattenableReadBuffer& buffer) {
|
||||
this->setTextSize(buffer.readScalar());
|
||||
this->setTextScaleX(buffer.readScalar());
|
||||
this->setTextSkewX(buffer.readScalar());
|
||||
#ifdef SK_SUPPORT_HINTING_SCALE_FACTOR
|
||||
this->setHintingScaleFactor(buffer.readScalar());
|
||||
#else
|
||||
// Skip the hinting scalar factor, which is not supported.
|
||||
buffer.readScalar();
|
||||
#endif
|
||||
this->setStrokeWidth(buffer.readScalar());
|
||||
this->setStrokeMiter(buffer.readScalar());
|
||||
this->setColor(buffer.readColor());
|
||||
|
@ -34,9 +34,6 @@ struct SkScalerContextRec {
|
||||
SkScalar fTextSize, fPreScaleX, fPreSkewX;
|
||||
SkScalar fPost2x2[2][2];
|
||||
SkScalar fFrameWidth, fMiterLimit;
|
||||
#ifdef SK_SUPPORT_HINTING_SCALE_FACTOR
|
||||
SkScalar fHintingScaleFactor;
|
||||
#endif
|
||||
|
||||
//These describe the parameters to create (uniquely identify) the pre-blend.
|
||||
uint32_t fLumBits;
|
||||
|
@ -794,34 +794,9 @@ SkScalerContext_FreeType::SkScalerContext_FreeType(SkTypeface* typeface,
|
||||
fMatrix22.xx = fMatrix22.yy = SK_Fixed1;
|
||||
fMatrix22.xy = fMatrix22.yx = 0;
|
||||
}
|
||||
|
||||
#ifdef SK_SUPPORT_HINTING_SCALE_FACTOR
|
||||
if (fRec.getHinting() == SkPaint::kNo_Hinting) {
|
||||
fScale.set(sx, sy);
|
||||
fScaleX = SkScalarToFixed(sx);
|
||||
fScaleY = SkScalarToFixed(sy);
|
||||
} else {
|
||||
SkScalar hintingScaleFactor = fRec.fHintingScaleFactor;
|
||||
|
||||
fScale.set(sx / hintingScaleFactor, sy / hintingScaleFactor);
|
||||
fScaleX = SkScalarToFixed(fScale.fX);
|
||||
fScaleY = SkScalarToFixed(fScale.fY);
|
||||
|
||||
fMatrix22.xx *= hintingScaleFactor;
|
||||
fMatrix22.xy *= hintingScaleFactor;
|
||||
fMatrix22.yx *= hintingScaleFactor;
|
||||
fMatrix22.yy *= hintingScaleFactor;
|
||||
|
||||
fMatrix22Scalar.setScaleX(fMatrix22Scalar.getScaleX() * hintingScaleFactor);
|
||||
fMatrix22Scalar.setSkewX(fMatrix22Scalar..getSkewX() * hintingScaleFactor);
|
||||
fMatrix22Scalar.setSkewY(fMatrix22Scalar..getSkewY() * hintingScaleFactor);
|
||||
fMatrix22Scalar.setScaleY(fMatrix22Scalar..getScaleY() * hintingScaleFactor);
|
||||
}
|
||||
#else
|
||||
fScale.set(sx, sy);
|
||||
fScaleX = SkScalarToFixed(sx);
|
||||
fScaleY = SkScalarToFixed(sy);
|
||||
#endif
|
||||
|
||||
fLCDIsVert = SkToBool(fRec.fFlags & SkScalerContext::kLCD_Vertical_Flag);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user