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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 #include "platform/PlatformExport.h" | 31 #include "platform/PlatformExport.h" |
32 #include "platform/fonts/Font.h" | 32 #include "platform/fonts/Font.h" |
33 #include "platform/geometry/FloatRect.h" | 33 #include "platform/geometry/FloatRect.h" |
34 #include "platform/graphics/DashArray.h" | 34 #include "platform/graphics/DashArray.h" |
35 #include "platform/graphics/DrawLooperBuilder.h" | 35 #include "platform/graphics/DrawLooperBuilder.h" |
36 #include "platform/graphics/ImageBufferSurface.h" | 36 #include "platform/graphics/ImageBufferSurface.h" |
37 #include "platform/graphics/ImageOrientation.h" | 37 #include "platform/graphics/ImageOrientation.h" |
38 #include "platform/graphics/GraphicsContextAnnotation.h" | 38 #include "platform/graphics/GraphicsContextAnnotation.h" |
39 #include "platform/graphics/GraphicsContextState.h" | 39 #include "platform/graphics/GraphicsContextState.h" |
40 #include "platform/graphics/skia/OpaqueRegionSkia.h" | 40 #include "platform/graphics/RegionTracker.h" |
41 #include "wtf/FastAllocBase.h" | 41 #include "wtf/FastAllocBase.h" |
42 #include "wtf/Forward.h" | 42 #include "wtf/Forward.h" |
43 #include "wtf/Noncopyable.h" | 43 #include "wtf/Noncopyable.h" |
44 #include "wtf/PassOwnPtr.h" | 44 #include "wtf/PassOwnPtr.h" |
45 | 45 |
46 class SkBitmap; | 46 class SkBitmap; |
47 class SkPaint; | 47 class SkPaint; |
48 class SkPath; | 48 class SkPath; |
49 class SkRRect; | 49 class SkRRect; |
50 struct SkRect; | 50 struct SkRect; |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 // context. Bitmap shouldn't be resampled when printing to keep the best | 216 // context. Bitmap shouldn't be resampled when printing to keep the best |
217 // possible quality. | 217 // possible quality. |
218 bool printing() const { return m_printing; } | 218 bool printing() const { return m_printing; } |
219 void setPrinting(bool printing) { m_printing = printing; } | 219 void setPrinting(bool printing) { m_printing = printing; } |
220 | 220 |
221 bool isAccelerated() const { return m_accelerated; } | 221 bool isAccelerated() const { return m_accelerated; } |
222 void setAccelerated(bool accelerated) { m_accelerated = accelerated; } | 222 void setAccelerated(bool accelerated) { m_accelerated = accelerated; } |
223 | 223 |
224 // The opaque region is empty until tracking is turned on. | 224 // The opaque region is empty until tracking is turned on. |
225 // It is never clerared by the context. | 225 // It is never clerared by the context. |
226 void setTrackOpaqueRegion(bool track) { m_trackOpaqueRegion = track; } | 226 enum RegionTrackingMode { |
227 const OpaqueRegionSkia& opaqueRegion() const { return m_opaqueRegion; } | 227 RegionTrackingDisabled = 0, |
| 228 RegionTrackingOpaque, |
| 229 RegionTrackingOverwrite |
| 230 }; |
| 231 void setRegionTrackingMode(RegionTrackingMode); |
| 232 bool regionTrackingEnabled() { return m_regionTrackingMode != RegionTracking
Disabled; } |
| 233 const RegionTracker& opaqueRegion() const { return m_trackedRegion; } |
228 | 234 |
229 // The text region is empty until tracking is turned on. | 235 // The text region is empty until tracking is turned on. |
230 // It is never clerared by the context. | 236 // It is never clerared by the context. |
231 void setTrackTextRegion(bool track) { m_trackTextRegion = track; } | 237 void setTrackTextRegion(bool track) { m_trackTextRegion = track; } |
232 const SkRect& textRegion() const { return m_textRegion; } | 238 const SkRect& textRegion() const { return m_textRegion; } |
233 | 239 |
234 bool updatingControlTints() const { return m_updatingControlTints; } | 240 bool updatingControlTints() const { return m_updatingControlTints; } |
235 void setUpdatingControlTints(bool updatingTints) { m_updatingControlTints =
updatingTints; } | 241 void setUpdatingControlTints(bool updatingTints) { m_updatingControlTints =
updatingTints; } |
236 | 242 |
237 AnnotationModeFlags annotationMode() const { return m_annotationMode; } | 243 AnnotationModeFlags annotationMode() const { return m_annotationMode; } |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 | 519 |
514 struct RecordingState; | 520 struct RecordingState; |
515 Vector<RecordingState> m_recordingStateStack; | 521 Vector<RecordingState> m_recordingStateStack; |
516 | 522 |
517 #if ENABLE(ASSERT) | 523 #if ENABLE(ASSERT) |
518 unsigned m_annotationCount; | 524 unsigned m_annotationCount; |
519 unsigned m_layerCount; | 525 unsigned m_layerCount; |
520 bool m_disableDestructionChecks; | 526 bool m_disableDestructionChecks; |
521 #endif | 527 #endif |
522 // Tracks the region painted opaque via the GraphicsContext. | 528 // Tracks the region painted opaque via the GraphicsContext. |
523 OpaqueRegionSkia m_opaqueRegion; | 529 RegionTracker m_trackedRegion; |
524 | 530 |
525 // Tracks the region where text is painted via the GraphicsContext. | 531 // Tracks the region where text is painted via the GraphicsContext. |
526 SkRect m_textRegion; | 532 SkRect m_textRegion; |
527 | 533 |
528 unsigned m_disabledState; | 534 unsigned m_disabledState; |
529 | 535 |
530 float m_deviceScaleFactor; | 536 float m_deviceScaleFactor; |
531 | 537 |
532 // Activation for the above region tracking features | 538 // Activation for the above region tracking features |
533 bool m_trackOpaqueRegion : 1; | 539 unsigned m_regionTrackingMode : 2; |
534 bool m_trackTextRegion : 1; | 540 bool m_trackTextRegion : 1; |
535 | 541 |
536 // FIXME: Make this go away: crbug.com/236892 | 542 // FIXME: Make this go away: crbug.com/236892 |
537 bool m_updatingControlTints : 1; | 543 bool m_updatingControlTints : 1; |
538 bool m_accelerated : 1; | 544 bool m_accelerated : 1; |
539 bool m_isCertainlyOpaque : 1; | 545 bool m_isCertainlyOpaque : 1; |
540 bool m_printing : 1; | 546 bool m_printing : 1; |
541 bool m_antialiasHairlineImages : 1; | 547 bool m_antialiasHairlineImages : 1; |
542 }; | 548 }; |
543 | 549 |
544 } // namespace blink | 550 } // namespace blink |
545 | 551 |
546 #endif // GraphicsContext_h | 552 #endif // GraphicsContext_h |
OLD | NEW |