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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 // needed in some other way. | 105 // needed in some other way. |
106 // See bug# 372110 | 106 // See bug# 372110 |
107 bool isRecordingCanvas() const | 107 bool isRecordingCanvas() const |
108 { | 108 { |
109 return m_canvas->imageInfo().colorType() == kUnknown_SkColorType; | 109 return m_canvas->imageInfo().colorType() == kUnknown_SkColorType; |
110 } | 110 } |
111 | 111 |
112 // ---------- State management methods ----------------- | 112 // ---------- State management methods ----------------- |
113 void save(); | 113 void save(); |
114 void restore(); | 114 void restore(); |
| 115 unsigned saveCount() { return m_canvasStateStack.size(); } |
| 116 #if !ASSERT_DISABLED |
| 117 void disableDestructionChecks() { m_disableDestructionChecks = true; } |
| 118 #endif |
115 | 119 |
116 void saveLayer(const SkRect* bounds, const SkPaint*); | 120 void saveLayer(const SkRect* bounds, const SkPaint*); |
117 void restoreLayer(); | 121 void restoreLayer(); |
118 | 122 |
119 float strokeThickness() const { return immutableState()->strokeData().thickn
ess(); } | 123 float strokeThickness() const { return immutableState()->strokeData().thickn
ess(); } |
120 void setStrokeThickness(float thickness) { mutableState()->setStrokeThicknes
s(thickness); } | 124 void setStrokeThickness(float thickness) { mutableState()->setStrokeThicknes
s(thickness); } |
121 | 125 |
122 StrokeStyle strokeStyle() const { return immutableState()->strokeData().styl
e(); } | 126 StrokeStyle strokeStyle() const { return immutableState()->strokeData().styl
e(); } |
123 void setStrokeStyle(StrokeStyle style) { mutableState()->setStrokeStyle(styl
e); } | 127 void setStrokeStyle(StrokeStyle style) { mutableState()->setStrokeStyle(styl
e); } |
124 | 128 |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 bool m_pendingCanvasSave; | 510 bool m_pendingCanvasSave; |
507 | 511 |
508 AnnotationModeFlags m_annotationMode; | 512 AnnotationModeFlags m_annotationMode; |
509 | 513 |
510 struct RecordingState; | 514 struct RecordingState; |
511 Vector<RecordingState> m_recordingStateStack; | 515 Vector<RecordingState> m_recordingStateStack; |
512 | 516 |
513 #if !ASSERT_DISABLED | 517 #if !ASSERT_DISABLED |
514 unsigned m_annotationCount; | 518 unsigned m_annotationCount; |
515 unsigned m_layerCount; | 519 unsigned m_layerCount; |
| 520 bool m_disableDestructionChecks; |
516 #endif | 521 #endif |
517 // Tracks the region painted opaque via the GraphicsContext. | 522 // Tracks the region painted opaque via the GraphicsContext. |
518 OpaqueRegionSkia m_opaqueRegion; | 523 OpaqueRegionSkia m_opaqueRegion; |
519 | 524 |
520 // Tracks the region where text is painted via the GraphicsContext. | 525 // Tracks the region where text is painted via the GraphicsContext. |
521 SkRect m_textRegion; | 526 SkRect m_textRegion; |
522 | 527 |
523 unsigned m_disabledState; | 528 unsigned m_disabledState; |
524 | 529 |
525 // Activation for the above region tracking features | 530 // Activation for the above region tracking features |
526 bool m_trackOpaqueRegion : 1; | 531 bool m_trackOpaqueRegion : 1; |
527 bool m_trackTextRegion : 1; | 532 bool m_trackTextRegion : 1; |
528 | 533 |
529 // Are we on a high DPI display? If so, spelling and grammar markers are lar
ger. | 534 // Are we on a high DPI display? If so, spelling and grammar markers are lar
ger. |
530 bool m_useHighResMarker : 1; | 535 bool m_useHighResMarker : 1; |
531 // FIXME: Make this go away: crbug.com/236892 | 536 // FIXME: Make this go away: crbug.com/236892 |
532 bool m_updatingControlTints : 1; | 537 bool m_updatingControlTints : 1; |
533 bool m_accelerated : 1; | 538 bool m_accelerated : 1; |
534 bool m_isCertainlyOpaque : 1; | 539 bool m_isCertainlyOpaque : 1; |
535 bool m_printing : 1; | 540 bool m_printing : 1; |
536 bool m_antialiasHairlineImages : 1; | 541 bool m_antialiasHairlineImages : 1; |
537 }; | 542 }; |
538 | 543 |
539 } // namespace WebCore | 544 } // namespace WebCore |
540 | 545 |
541 #endif // GraphicsContext_h | 546 #endif // GraphicsContext_h |
OLD | NEW |