| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008-2009 Torch Mobile, Inc. | 3 * Copyright (C) 2008-2009 Torch Mobile, Inc. |
| 4 * Copyright (C) 2013 Google Inc. All rights reserved. | 4 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 // Disable the anti-aliasing optimization for scales/multiple-of-90-degrees | 154 // Disable the anti-aliasing optimization for scales/multiple-of-90-degrees |
| 155 // rotations of thin ("hairline") images. | 155 // rotations of thin ("hairline") images. |
| 156 // Note: This will only be reliable when the device pixel scale/ratio is | 156 // Note: This will only be reliable when the device pixel scale/ratio is |
| 157 // fixed (e.g. when drawing to context backed by an ImageBuffer). | 157 // fixed (e.g. when drawing to context backed by an ImageBuffer). |
| 158 void disableAntialiasingOptimizationForHairlineImages() { ASSERT(!isRecordin
g()); m_antialiasHairlineImages = true; } | 158 void disableAntialiasingOptimizationForHairlineImages() { ASSERT(!isRecordin
g()); m_antialiasHairlineImages = true; } |
| 159 bool shouldAntialiasHairlineImages() const { return m_antialiasHairlineImage
s; } | 159 bool shouldAntialiasHairlineImages() const { return m_antialiasHairlineImage
s; } |
| 160 | 160 |
| 161 void setShouldClampToSourceRect(bool clampToSourceRect) { mutableState()->se
tShouldClampToSourceRect(clampToSourceRect); } | 161 void setShouldClampToSourceRect(bool clampToSourceRect) { mutableState()->se
tShouldClampToSourceRect(clampToSourceRect); } |
| 162 bool shouldClampToSourceRect() const { return immutableState()->shouldClampT
oSourceRect(); } | 162 bool shouldClampToSourceRect() const { return immutableState()->shouldClampT
oSourceRect(); } |
| 163 | 163 |
| 164 void setShouldSmoothFonts(bool smoothFonts) { mutableState()->setShouldSmoot
hFonts(smoothFonts); } | 164 // FIXME: the setter is only used once, at construction time; convert to a c
onstructor param, |
| 165 bool shouldSmoothFonts() const { return immutableState()->shouldSmoothFonts(
); } | 165 // and possibly consolidate with other flags (paintDisabled, isPrinting, ...
) |
| 166 void setShouldSmoothFonts(bool smoothFonts) { m_shouldSmoothFonts = smoothFo
nts; } |
| 167 bool shouldSmoothFonts() const { return m_shouldSmoothFonts; } |
| 166 | 168 |
| 167 // Turn off LCD text for the paint if not supported on this context. | 169 // Turn off LCD text for the paint if not supported on this context. |
| 168 void adjustTextRenderMode(SkPaint*); | 170 void adjustTextRenderMode(SkPaint*); |
| 169 bool couldUseLCDRenderedText(); | 171 bool couldUseLCDRenderedText(); |
| 170 | 172 |
| 171 void setTextDrawingMode(TextDrawingModeFlags mode) { mutableState()->setText
DrawingMode(mode); } | 173 void setTextDrawingMode(TextDrawingModeFlags mode) { mutableState()->setText
DrawingMode(mode); } |
| 172 TextDrawingModeFlags textDrawingMode() const { return immutableState()->text
DrawingMode(); } | 174 TextDrawingModeFlags textDrawingMode() const { return immutableState()->text
DrawingMode(); } |
| 173 | 175 |
| 174 void setAlphaAsFloat(float alpha) { mutableState()->setAlphaAsFloat(alpha);} | 176 void setAlphaAsFloat(float alpha) { mutableState()->setAlphaAsFloat(alpha);} |
| 175 int getNormalizedAlpha() const | 177 int getNormalizedAlpha() const |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 float m_deviceScaleFactor; | 530 float m_deviceScaleFactor; |
| 529 | 531 |
| 530 // Activation for the above region tracking features | 532 // Activation for the above region tracking features |
| 531 unsigned m_regionTrackingMode : 2; | 533 unsigned m_regionTrackingMode : 2; |
| 532 bool m_trackTextRegion : 1; | 534 bool m_trackTextRegion : 1; |
| 533 | 535 |
| 534 bool m_accelerated : 1; | 536 bool m_accelerated : 1; |
| 535 bool m_isCertainlyOpaque : 1; | 537 bool m_isCertainlyOpaque : 1; |
| 536 bool m_printing : 1; | 538 bool m_printing : 1; |
| 537 bool m_antialiasHairlineImages : 1; | 539 bool m_antialiasHairlineImages : 1; |
| 540 bool m_shouldSmoothFonts : 1; |
| 538 }; | 541 }; |
| 539 | 542 |
| 540 } // namespace blink | 543 } // namespace blink |
| 541 | 544 |
| 542 #endif // GraphicsContext_h | 545 #endif // GraphicsContext_h |
| OLD | NEW |