Index: src/core/SkPaint.cpp |
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp |
index 88bde227044a76b702a7a6be0f010b48b0b33928..42144c102992e779fe0b7d883a1f43ab7c18aaaf 100644 |
--- a/src/core/SkPaint.cpp |
+++ b/src/core/SkPaint.cpp |
@@ -1607,19 +1607,33 @@ void SkScalerContext::MakeRec(const SkPaint& paint, |
rec->fMaskFormat = SkToU8(computeMaskFormat(paint)); |
- SkDeviceProperties::Geometry geometry = deviceProperties |
- ? deviceProperties->fGeometry |
- : SkDeviceProperties::Geometry::MakeDefault(); |
if (SkMask::kLCD16_Format == rec->fMaskFormat || SkMask::kLCD32_Format == rec->fMaskFormat) { |
- if (!geometry.isOrientationKnown() || !geometry.isLayoutKnown() || tooBigForLCD(*rec)) { |
- // eeek, can't support LCD |
+ if (tooBigForLCD(*rec)) { |
rec->fMaskFormat = SkMask::kA8_Format; |
+ flags |= SkScalerContext::kGenA8FromLCD_Flag; |
} else { |
- if (SkDeviceProperties::Geometry::kVertical_Orientation == geometry.getOrientation()) { |
- flags |= SkScalerContext::kLCD_Vertical_Flag; |
- } |
- if (SkDeviceProperties::Geometry::kBGR_Layout == geometry.getLayout()) { |
- flags |= SkScalerContext::kLCD_BGROrder_Flag; |
+ SkPixelGeometry geometry = deviceProperties |
+ ? deviceProperties->fPixelGeometry |
+ : SkSurfacePropsDefaultPixelGeometry(); |
+ switch (geometry) { |
+ case kUnknown_SkPixelGeometry: |
+ // eeek, can't support LCD |
+ rec->fMaskFormat = SkMask::kA8_Format; |
+ flags |= SkScalerContext::kGenA8FromLCD_Flag; |
+ break; |
+ case kRGB_H_SkPixelGeometry: |
+ // our default, do nothing. |
+ break; |
+ case kBGR_H_SkPixelGeometry: |
+ flags |= SkScalerContext::kLCD_BGROrder_Flag; |
+ break; |
+ case kRGB_V_SkPixelGeometry: |
+ flags |= SkScalerContext::kLCD_Vertical_Flag; |
+ break; |
+ case kBGR_V_SkPixelGeometry: |
+ flags |= SkScalerContext::kLCD_Vertical_Flag; |
+ flags |= SkScalerContext::kLCD_BGROrder_Flag; |
+ break; |
} |
} |
} |
@@ -1650,13 +1664,13 @@ void SkScalerContext::MakeRec(const SkPaint& paint, |
rec->setDeviceGamma(SK_GAMMA_EXPONENT); |
rec->setPaintGamma(SK_GAMMA_EXPONENT); |
} else { |
- rec->setDeviceGamma(deviceProperties->fGamma); |
+ rec->setDeviceGamma(deviceProperties->getGamma()); |
//For now always set the paint gamma equal to the device gamma. |
//The math in SkMaskGamma can handle them being different, |
//but it requires superluminous masks when |
//Ex : deviceGamma(x) < paintGamma(x) and x is sufficiently large. |
- rec->setPaintGamma(deviceProperties->fGamma); |
+ rec->setPaintGamma(deviceProperties->getGamma()); |
} |
#ifdef SK_GAMMA_CONTRAST |