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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 return alpha > 255 ? 255 : alpha; | 190 return alpha > 255 ? 255 : alpha; |
191 } | 191 } |
192 | 192 |
193 void setImageInterpolationQuality(InterpolationQuality quality) { mutableSta
te()->setInterpolationQuality(quality); } | 193 void setImageInterpolationQuality(InterpolationQuality quality) { mutableSta
te()->setInterpolationQuality(quality); } |
194 InterpolationQuality imageInterpolationQuality() const { return immutableSta
te()->interpolationQuality(); } | 194 InterpolationQuality imageInterpolationQuality() const { return immutableSta
te()->interpolationQuality(); } |
195 | 195 |
196 void setCompositeOperation(CompositeOperator, blink::WebBlendMode = blink::W
ebBlendModeNormal); | 196 void setCompositeOperation(CompositeOperator, blink::WebBlendMode = blink::W
ebBlendModeNormal); |
197 CompositeOperator compositeOperation() const { return immutableState()->comp
ositeOperator(); } | 197 CompositeOperator compositeOperation() const { return immutableState()->comp
ositeOperator(); } |
198 blink::WebBlendMode blendModeOperation() const { return immutableState()->bl
endMode(); } | 198 blink::WebBlendMode blendModeOperation() const { return immutableState()->bl
endMode(); } |
199 | 199 |
200 // Change the way document markers are rendered. | 200 // Speicy the device scale factor which may change the way document markers |
201 // Any deviceScaleFactor higher than 1.5 is enough to justify setting this f
lag. | 201 // and fonts are rendered. |
202 void setUseHighResMarkers(bool isHighRes) { m_useHighResMarker = isHighRes;
} | 202 void setDeviceScaleFactor(float factor) { m_deviceScaleFactor = factor; } |
| 203 float deviceScaleFactor() const { return m_deviceScaleFactor; } |
203 | 204 |
204 // If true we are (most likely) rendering to a web page and the | 205 // If true we are (most likely) rendering to a web page and the |
205 // canvas has been prepared with an opaque background. If false, | 206 // canvas has been prepared with an opaque background. If false, |
206 // the canvas may have transparency (as is the case when rendering | 207 // the canvas may have transparency (as is the case when rendering |
207 // to a canvas object). | 208 // to a canvas object). |
208 void setCertainlyOpaque(bool isOpaque) { m_isCertainlyOpaque = isOpaque; } | 209 void setCertainlyOpaque(bool isOpaque) { m_isCertainlyOpaque = isOpaque; } |
209 bool isCertainlyOpaque() const { return m_isCertainlyOpaque; } | 210 bool isCertainlyOpaque() const { return m_isCertainlyOpaque; } |
210 | 211 |
211 // Returns if the context is a printing context instead of a display | 212 // Returns if the context is a printing context instead of a display |
212 // context. Bitmap shouldn't be resampled when printing to keep the best | 213 // context. Bitmap shouldn't be resampled when printing to keep the best |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 bool m_disableDestructionChecks; | 507 bool m_disableDestructionChecks; |
507 #endif | 508 #endif |
508 // Tracks the region painted opaque via the GraphicsContext. | 509 // Tracks the region painted opaque via the GraphicsContext. |
509 OpaqueRegionSkia m_opaqueRegion; | 510 OpaqueRegionSkia m_opaqueRegion; |
510 | 511 |
511 // Tracks the region where text is painted via the GraphicsContext. | 512 // Tracks the region where text is painted via the GraphicsContext. |
512 SkRect m_textRegion; | 513 SkRect m_textRegion; |
513 | 514 |
514 unsigned m_disabledState; | 515 unsigned m_disabledState; |
515 | 516 |
| 517 float m_deviceScaleFactor; |
| 518 |
516 // Activation for the above region tracking features | 519 // Activation for the above region tracking features |
517 bool m_trackOpaqueRegion : 1; | 520 bool m_trackOpaqueRegion : 1; |
518 bool m_trackTextRegion : 1; | 521 bool m_trackTextRegion : 1; |
519 | 522 |
520 // Are we on a high DPI display? If so, spelling and grammar markers are lar
ger. | |
521 bool m_useHighResMarker : 1; | |
522 // FIXME: Make this go away: crbug.com/236892 | 523 // FIXME: Make this go away: crbug.com/236892 |
523 bool m_updatingControlTints : 1; | 524 bool m_updatingControlTints : 1; |
524 bool m_accelerated : 1; | 525 bool m_accelerated : 1; |
525 bool m_isCertainlyOpaque : 1; | 526 bool m_isCertainlyOpaque : 1; |
526 bool m_printing : 1; | 527 bool m_printing : 1; |
527 bool m_antialiasHairlineImages : 1; | 528 bool m_antialiasHairlineImages : 1; |
528 }; | 529 }; |
529 | 530 |
530 } // namespace WebCore | 531 } // namespace WebCore |
531 | 532 |
532 #endif // GraphicsContext_h | 533 #endif // GraphicsContext_h |
OLD | NEW |