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

Unified Diff: src/core/SkPaint.cpp

Issue 583773004: Revert of introduce Props to surface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkDeviceProperties.h ('k') | src/core/SkPictureRecord.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPaint.cpp
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 42144c102992e779fe0b7d883a1f43ab7c18aaaf..88bde227044a76b702a7a6be0f010b48b0b33928 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -1607,33 +1607,19 @@
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 (tooBigForLCD(*rec)) {
+ if (!geometry.isOrientationKnown() || !geometry.isLayoutKnown() || tooBigForLCD(*rec)) {
+ // eeek, can't support LCD
rec->fMaskFormat = SkMask::kA8_Format;
- flags |= SkScalerContext::kGenA8FromLCD_Flag;
} else {
- 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;
+ if (SkDeviceProperties::Geometry::kVertical_Orientation == geometry.getOrientation()) {
+ flags |= SkScalerContext::kLCD_Vertical_Flag;
+ }
+ if (SkDeviceProperties::Geometry::kBGR_Layout == geometry.getLayout()) {
+ flags |= SkScalerContext::kLCD_BGROrder_Flag;
}
}
}
@@ -1664,13 +1650,13 @@
rec->setDeviceGamma(SK_GAMMA_EXPONENT);
rec->setPaintGamma(SK_GAMMA_EXPONENT);
} else {
- rec->setDeviceGamma(deviceProperties->getGamma());
+ rec->setDeviceGamma(deviceProperties->fGamma);
//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->getGamma());
+ rec->setPaintGamma(deviceProperties->fGamma);
}
#ifdef SK_GAMMA_CONTRAST
« no previous file with comments | « src/core/SkDeviceProperties.h ('k') | src/core/SkPictureRecord.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698