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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 | 161 |
162 void setShouldClampToSourceRect(bool clampToSourceRect) { mutableState()->se
tShouldClampToSourceRect(clampToSourceRect); } | 162 void setShouldClampToSourceRect(bool clampToSourceRect) { mutableState()->se
tShouldClampToSourceRect(clampToSourceRect); } |
163 bool shouldClampToSourceRect() const { return immutableState()->shouldClampT
oSourceRect(); } | 163 bool shouldClampToSourceRect() const { return immutableState()->shouldClampT
oSourceRect(); } |
164 | 164 |
165 // FIXME: the setter is only used once, at construction time; convert to a c
onstructor param, | 165 // FIXME: the setter is only used once, at construction time; convert to a c
onstructor param, |
166 // and possibly consolidate with other flags (paintDisabled, isPrinting, ...
) | 166 // and possibly consolidate with other flags (paintDisabled, isPrinting, ...
) |
167 void setShouldSmoothFonts(bool smoothFonts) { m_shouldSmoothFonts = smoothFo
nts; } | 167 void setShouldSmoothFonts(bool smoothFonts) { m_shouldSmoothFonts = smoothFo
nts; } |
168 bool shouldSmoothFonts() const { return m_shouldSmoothFonts; } | 168 bool shouldSmoothFonts() const { return m_shouldSmoothFonts; } |
169 | 169 |
170 // Turn off LCD text for the paint if not supported on this context. | 170 // Turn off LCD text for the paint if not supported on this context. |
171 void adjustTextRenderMode(SkPaint*); | 171 void adjustTextRenderMode(SkPaint*) const; |
172 bool couldUseLCDRenderedText(); | 172 bool couldUseLCDRenderedText() const; |
173 | 173 |
174 void setTextDrawingMode(TextDrawingModeFlags mode) { mutableState()->setText
DrawingMode(mode); } | 174 void setTextDrawingMode(TextDrawingModeFlags mode) { mutableState()->setText
DrawingMode(mode); } |
175 TextDrawingModeFlags textDrawingMode() const { return immutableState()->text
DrawingMode(); } | 175 TextDrawingModeFlags textDrawingMode() const { return immutableState()->text
DrawingMode(); } |
176 | 176 |
177 void setAlphaAsFloat(float alpha) { mutableState()->setAlphaAsFloat(alpha);} | 177 void setAlphaAsFloat(float alpha) { mutableState()->setAlphaAsFloat(alpha);} |
178 int getNormalizedAlpha() const | 178 int getNormalizedAlpha() const |
179 { | 179 { |
180 int alpha = immutableState()->alpha(); | 180 int alpha = immutableState()->alpha(); |
181 return alpha > 255 ? 255 : alpha; | 181 return alpha > 255 ? 255 : alpha; |
182 } | 182 } |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 bool m_accelerated : 1; | 536 bool m_accelerated : 1; |
537 bool m_isCertainlyOpaque : 1; | 537 bool m_isCertainlyOpaque : 1; |
538 bool m_printing : 1; | 538 bool m_printing : 1; |
539 bool m_antialiasHairlineImages : 1; | 539 bool m_antialiasHairlineImages : 1; |
540 bool m_shouldSmoothFonts : 1; | 540 bool m_shouldSmoothFonts : 1; |
541 }; | 541 }; |
542 | 542 |
543 } // namespace blink | 543 } // namespace blink |
544 | 544 |
545 #endif // GraphicsContext_h | 545 #endif // GraphicsContext_h |
OLD | NEW |