2 * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2008-2009 Torch Mobile, Inc.
4 * Copyright (C) 2013 Google Inc. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
16 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
19 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
23 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 #ifndef GraphicsContext_h
29 #define GraphicsContext_h
31 #include "platform/PlatformExport.h"
32 #include "platform/fonts/Font.h"
33 #include "platform/geometry/FloatRect.h"
34 #include "platform/graphics/DashArray.h"
35 #include "platform/graphics/DrawLooperBuilder.h"
36 #include "platform/graphics/ImageBufferSurface.h"
37 #include "platform/graphics/ImageFilter.h"
38 #include "platform/graphics/ImageOrientation.h"
39 #include "platform/graphics/GraphicsContextAnnotation.h"
40 #include "platform/graphics/GraphicsContextState.h"
41 #include "platform/graphics/RegionTracker.h"
42 #include "platform/graphics/skia/SkiaUtils.h"
43 #include "wtf/FastAllocBase.h"
44 #include "wtf/Forward.h"
45 #include "wtf/Noncopyable.h"
46 #include "wtf/PassOwnPtr.h"
61 class PLATFORM_EXPORT GraphicsContext {
62 WTF_MAKE_NONCOPYABLE(GraphicsContext); WTF_MAKE_FAST_ALLOCATED;
64 enum AntiAliasingMode {
74 NothingDisabled = 0, // Run as normal.
75 FullyDisabled = 1 // Do absolutely minimal work to remove the cost of the context from performance tests.
78 // A 0 canvas is allowed, but in such cases the context must only have canvas
79 // related commands called when within a beginRecording/endRecording block.
80 // Furthermore, save/restore calls must be balanced any time the canvas is 0.
81 explicit GraphicsContext(SkCanvas*, DisabledMode = NothingDisabled);
85 SkCanvas* canvas() { return m_canvas; }
86 const SkCanvas* canvas() const { return m_canvas; }
88 void resetCanvas(SkCanvas*);
90 bool contextDisabled() const { return m_disabledState; }
92 // ---------- State management methods -----------------
97 unsigned saveCount() const;
98 void disableDestructionChecks() { m_disableDestructionChecks = true; }
101 bool hasStroke() const { return strokeStyle() != NoStroke && strokeThickness() > 0; }
103 float strokeThickness() const { return immutableState()->strokeData().thickness(); }
104 void setStrokeThickness(float thickness) { mutableState()->setStrokeThickness(thickness); }
106 StrokeStyle strokeStyle() const { return immutableState()->strokeData().style(); }
107 void setStrokeStyle(StrokeStyle style) { mutableState()->setStrokeStyle(style); }
109 Color strokeColor() const { return immutableState()->strokeColor(); }
110 void setStrokeColor(const Color& color) { mutableState()->setStrokeColor(color); }
111 SkColor effectiveStrokeColor() const { return immutableState()->effectiveStrokeColor(); }
113 Pattern* strokePattern() const { return immutableState()->strokePattern(); }
114 void setStrokePattern(PassRefPtr<Pattern>);
116 Gradient* strokeGradient() const { return immutableState()->strokeGradient(); }
117 void setStrokeGradient(PassRefPtr<Gradient>);
119 void setLineCap(LineCap cap) { mutableState()->setLineCap(cap); }
120 void setLineDash(const DashArray& dashes, float dashOffset) { mutableState()->setLineDash(dashes, dashOffset); }
121 void setLineJoin(LineJoin join) { mutableState()->setLineJoin(join); }
122 void setMiterLimit(float limit) { mutableState()->setMiterLimit(limit); }
124 WindRule fillRule() const { return immutableState()->fillRule(); }
125 void setFillRule(WindRule fillRule) { mutableState()->setFillRule(fillRule); }
127 Color fillColor() const { return immutableState()->fillColor(); }
128 void setFillColor(const Color& color) { mutableState()->setFillColor(color); }
129 SkColor effectiveFillColor() const { return immutableState()->effectiveFillColor(); }
131 void setFillPattern(PassRefPtr<Pattern>);
132 Pattern* fillPattern() const { return immutableState()->fillPattern(); }
134 void setFillGradient(PassRefPtr<Gradient>);
135 Gradient* fillGradient() const { return immutableState()->fillGradient(); }
137 SkDrawLooper* drawLooper() const { return immutableState()->drawLooper(); }
139 bool getTransformedClipBounds(FloatRect* bounds) const;
140 SkMatrix getTotalMatrix() const;
142 void setShouldAntialias(bool antialias) { mutableState()->setShouldAntialias(antialias); }
143 bool shouldAntialias() const { return immutableState()->shouldAntialias(); }
145 // Disable the anti-aliasing optimization for scales/multiple-of-90-degrees
146 // rotations of thin ("hairline") images.
147 // Note: This will only be reliable when the device pixel scale/ratio is
148 // fixed (e.g. when drawing to context backed by an ImageBuffer).
149 void disableAntialiasingOptimizationForHairlineImages() { ASSERT(!isRecording()); m_antialiasHairlineImages = true; }
150 bool shouldAntialiasHairlineImages() const { return m_antialiasHairlineImages; }
152 void setShouldClampToSourceRect(bool clampToSourceRect) { mutableState()->setShouldClampToSourceRect(clampToSourceRect); }
153 bool shouldClampToSourceRect() const { return immutableState()->shouldClampToSourceRect(); }
155 // FIXME: the setter is only used once, at construction time; convert to a constructor param,
156 // and possibly consolidate with other flags (paintDisabled, isPrinting, ...)
157 void setShouldSmoothFonts(bool smoothFonts) { m_shouldSmoothFonts = smoothFonts; }
158 bool shouldSmoothFonts() const { return m_shouldSmoothFonts; }
160 // Turn off LCD text for the paint if not supported on this context.
161 void adjustTextRenderMode(SkPaint*) const;
162 bool couldUseLCDRenderedText() const;
164 void setTextDrawingMode(TextDrawingModeFlags mode) { mutableState()->setTextDrawingMode(mode); }
165 TextDrawingModeFlags textDrawingMode() const { return immutableState()->textDrawingMode(); }
167 void setAlphaAsFloat(float alpha) { mutableState()->setAlphaAsFloat(alpha);}
168 int getNormalizedAlpha() const
170 int alpha = immutableState()->alpha();
171 return alpha > 255 ? 255 : alpha;
174 void setImageInterpolationQuality(InterpolationQuality quality) { mutableState()->setInterpolationQuality(quality); }
175 InterpolationQuality imageInterpolationQuality() const { return immutableState()->interpolationQuality(); }
177 void setCompositeOperation(CompositeOperator, WebBlendMode = WebBlendModeNormal);
178 CompositeOperator compositeOperation() const { return immutableState()->compositeOperator(); }
179 WebBlendMode blendModeOperation() const { return immutableState()->blendMode(); }
181 // Speicy the device scale factor which may change the way document markers
182 // and fonts are rendered.
183 void setDeviceScaleFactor(float factor) { m_deviceScaleFactor = factor; }
184 float deviceScaleFactor() const { return m_deviceScaleFactor; }
186 // If true we are (most likely) rendering to a web page and the
187 // canvas has been prepared with an opaque background. If false,
188 // the canvas may have transparency (as is the case when rendering
189 // to a canvas object).
190 void setCertainlyOpaque(bool isOpaque) { m_isCertainlyOpaque = isOpaque; }
191 bool isCertainlyOpaque() const { return m_isCertainlyOpaque; }
193 // Returns if the context is a printing context instead of a display
194 // context. Bitmap shouldn't be resampled when printing to keep the best
196 bool printing() const { return m_printing; }
197 void setPrinting(bool printing) { m_printing = printing; }
199 bool isAccelerated() const { return m_accelerated; }
200 void setAccelerated(bool accelerated) { m_accelerated = accelerated; }
202 // The opaque region is empty until tracking is turned on.
203 // It is never clerared by the context.
204 enum RegionTrackingMode {
205 RegionTrackingDisabled = 0,
206 RegionTrackingOpaque,
207 RegionTrackingOverwrite
209 void setRegionTrackingMode(RegionTrackingMode);
210 bool regionTrackingEnabled() { return m_regionTrackingMode != RegionTrackingDisabled; }
211 const RegionTracker& opaqueRegion() const { return m_trackedRegion; }
213 // The text region is empty until tracking is turned on.
214 // It is never clerared by the context.
215 void setTrackTextRegion(bool track) { m_trackTextRegion = track; }
216 const SkRect& textRegion() const { return m_textRegion; }
218 AnnotationModeFlags annotationMode() const { return m_annotationMode; }
219 void setAnnotationMode(const AnnotationModeFlags mode) { m_annotationMode = mode; }
221 SkColorFilter* colorFilter() const;
222 void setColorFilter(ColorFilter);
223 // ---------- End state management methods -----------------
225 // Get the contents of the image buffer
226 bool readPixels(const SkImageInfo&, void* pixels, size_t rowBytes, int x, int y);
228 // Get the current fill style.
229 const SkPaint& fillPaint() const { return immutableState()->fillPaint(); }
231 // Get the current stroke style.
232 const SkPaint& strokePaint() const { return immutableState()->strokePaint(); }
234 // These draw methods will do both stroking and filling.
235 // FIXME: ...except drawRect(), which fills properly but always strokes
236 // using a 1-pixel stroke inset from the rect borders (of the correct
238 void drawRect(const IntRect&);
239 void drawLine(const IntPoint&, const IntPoint&);
241 void fillPolygon(size_t numPoints, const FloatPoint*, const Color&, bool shouldAntialias);
243 void fillPath(const Path&);
244 void strokePath(const Path&);
246 void fillEllipse(const FloatRect&);
247 void strokeEllipse(const FloatRect&);
249 void fillRect(const FloatRect&);
250 void fillRect(const FloatRect&, const Color&);
251 void fillRect(const FloatRect&, const Color&, CompositeOperator);
252 void fillRoundedRect(const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const Color&);
253 void fillRoundedRect(const RoundedRect&, const Color&);
255 void clearRect(const FloatRect&);
257 void strokeRect(const FloatRect&);
258 void strokeRect(const FloatRect&, float lineWidth);
260 void fillBetweenRoundedRects(const IntRect&, const IntSize& outerTopLeft, const IntSize& outerTopRight, const IntSize& outerBottomLeft, const IntSize& outerBottomRight,
261 const IntRect&, const IntSize& innerTopLeft, const IntSize& innerTopRight, const IntSize& innerBottomLeft, const IntSize& innerBottomRight, const Color&);
262 void fillBetweenRoundedRects(const RoundedRect&, const RoundedRect&, const Color&);
264 void drawDisplayList(DisplayList*);
265 void drawPicture(SkPicture*, const FloatPoint& location);
266 void drawPicture(SkPicture*, const FloatRect& dest, const FloatRect& src, CompositeOperator, WebBlendMode);
268 void drawImage(Image*, const IntPoint&, CompositeOperator = CompositeSourceOver, RespectImageOrientationEnum = DoNotRespectImageOrientation);
269 void drawImage(Image*, const IntRect&, CompositeOperator = CompositeSourceOver, RespectImageOrientationEnum = DoNotRespectImageOrientation);
270 void drawImage(Image*, const FloatRect& destRect);
271 void drawImage(Image*, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator = CompositeSourceOver, RespectImageOrientationEnum = DoNotRespectImageOrientation);
272 void drawImage(Image*, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator, WebBlendMode, RespectImageOrientationEnum = DoNotRespectImageOrientation);
274 void drawTiledImage(Image*, const IntRect& destRect, const IntPoint& srcPoint, const IntSize& tileSize,
275 CompositeOperator = CompositeSourceOver, WebBlendMode = WebBlendModeNormal, const IntSize& repeatSpacing = IntSize());
276 void drawTiledImage(Image*, const IntRect& destRect, const IntRect& srcRect,
277 const FloatSize& tileScaleFactor, Image::TileRule hRule = Image::StretchTile, Image::TileRule vRule = Image::StretchTile,
278 CompositeOperator = CompositeSourceOver);
280 void drawImageBuffer(ImageBuffer*, const FloatRect& destRect, const FloatRect* srcRect = 0, CompositeOperator = CompositeSourceOver, WebBlendMode = WebBlendModeNormal);
282 // These methods write to the canvas and modify the opaque region, if tracked.
283 // Also drawLine(const IntPoint& point1, const IntPoint& point2) and fillRoundedRect
284 void writePixels(const SkImageInfo&, const void* pixels, size_t rowBytes, int x, int y);
285 void drawBitmap(const SkBitmap&, SkScalar, SkScalar, const SkPaint* = 0);
286 void drawBitmapRect(const SkBitmap&, const SkRect*, const SkRect&, const SkPaint* = 0);
287 void drawOval(const SkRect&, const SkPaint&);
288 void drawPath(const SkPath&, const SkPaint&);
289 // After drawing directly to the context's canvas, use this function to notify the context so
290 // it can track the opaque region.
291 // FIXME: this is still needed only because ImageSkia::paintSkBitmap() may need to notify for a
292 // smaller rect than the one drawn to, due to its clipping logic.
293 void didDrawRect(const SkRect&, const SkPaint&, const SkBitmap* = 0);
294 void drawRect(const SkRect&, const SkPaint&);
295 void drawPosText(const void* text, size_t byteLength, const SkPoint pos[], const SkRect& textRect, const SkPaint&);
296 void drawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[], SkScalar constY, const SkRect& textRect, const SkPaint&);
297 void drawTextBlob(const SkTextBlob*, const SkPoint& origin, const SkPaint&);
299 void clip(const IntRect& rect) { clipRect(rect); }
300 void clip(const FloatRect& rect) { clipRect(rect); }
301 void clipRoundedRect(const RoundedRect&, SkRegion::Op = SkRegion::kIntersect_Op);
302 void clipOut(const IntRect& rect) { clipRect(rect, NotAntiAliased, SkRegion::kDifference_Op); }
303 void clipOut(const Path&);
304 void clipOutRoundedRect(const RoundedRect&);
305 void clipPath(const Path&, WindRule = RULE_EVENODD);
306 void clipPolygon(size_t numPoints, const FloatPoint*, bool antialias);
307 void clipRect(const SkRect&, AntiAliasingMode = NotAntiAliased, SkRegion::Op = SkRegion::kIntersect_Op);
308 // This clip function is used only by <canvas> code. It allows
309 // implementations to handle clipping on the canvas differently since
310 // the discipline is different.
311 void canvasClip(const Path&, WindRule = RULE_EVENODD, AntiAliasingMode = NotAntiAliased);
313 void drawText(const Font&, const TextRunPaintInfo&, const FloatPoint&);
314 void drawEmphasisMarks(const Font&, const TextRunPaintInfo&, const AtomicString& mark, const FloatPoint&);
315 void drawBidiText(const Font&, const TextRunPaintInfo&, const FloatPoint&, Font::CustomFontNotReadyAction = Font::DoNotPaintIfFontNotReady);
316 void drawHighlightForText(const Font&, const TextRun&, const FloatPoint&, int h, const Color& backgroundColor, int from = 0, int to = -1);
318 void drawLineForText(const FloatPoint&, float width, bool printing);
319 enum DocumentMarkerLineStyle {
320 DocumentMarkerSpellingLineStyle,
321 DocumentMarkerGrammarLineStyle
323 void drawLineForDocumentMarker(const FloatPoint&, float width, DocumentMarkerLineStyle);
325 // beginLayer()/endLayer() behaves like save()/restore() for only CTM and clip states.
326 void beginTransparencyLayer(float opacity, const FloatRect* = 0);
327 // Apply CompositeOperator when the layer is composited on the backdrop (i.e. endLayer()).
328 // Don't change the current CompositeOperator state.
329 void beginLayer(float opacity, CompositeOperator, const FloatRect* = 0, ColorFilter = ColorFilterNone, ImageFilter* = 0);
332 void beginCull(const FloatRect&);
335 // Instead of being dispatched to the active canvas, draw commands following beginRecording()
336 // are stored in a display list that can be replayed at a later time. Pass in the bounding
337 // rectangle for the content in the list.
338 void beginRecording(const FloatRect&, uint32_t = 0);
339 PassRefPtr<DisplayList> endRecording();
341 bool hasShadow() const;
342 void setShadow(const FloatSize& offset, float blur, const Color&,
343 DrawLooperBuilder::ShadowTransformMode = DrawLooperBuilder::ShadowRespectsTransforms,
344 DrawLooperBuilder::ShadowAlphaMode = DrawLooperBuilder::ShadowRespectsAlpha, ShadowMode = DrawShadowAndForeground);
345 void clearShadow() { clearDrawLooper(); clearDropShadowImageFilter(); }
347 // It is assumed that this draw looper is used only for shadows
348 // (i.e. a draw looper is set if and only if there is a shadow).
349 // The builder passed into this method will be destroyed.
350 void setDrawLooper(PassOwnPtr<DrawLooperBuilder>);
351 void clearDrawLooper();
353 void drawFocusRing(const Vector<IntRect>&, int width, int offset, const Color&);
354 void drawFocusRing(const Path&, int width, int offset, const Color&);
363 typedef unsigned Edges;
364 void drawInnerShadow(const RoundedRect&, const Color& shadowColor, const IntSize shadowOffset, int shadowBlur, int shadowSpread, Edges clippedEdges = NoEdge);
366 // ---------- Transformation methods -----------------
367 // Note that the getCTM method returns only the current transform from Blink's perspective,
368 // which is not the final transform used to place content on screen. It cannot be relied upon
369 // for testing where a point will appear on screen or how large it will be.
370 AffineTransform getCTM() const;
371 void concatCTM(const AffineTransform& affine) { concat(affineTransformToSkMatrix(affine)); }
372 void setCTM(const AffineTransform& affine) { setMatrix(affineTransformToSkMatrix(affine)); }
373 void setMatrix(const SkMatrix&);
375 void scale(float x, float y);
376 void rotate(float angleInRadians);
377 void translate(float x, float y);
379 // This function applies the device scale factor to the context, making the context capable of
380 // acting as a base-level context for a HiDPI environment.
381 void applyDeviceScaleFactor(float deviceScaleFactor) { scale(deviceScaleFactor, deviceScaleFactor); }
382 // ---------- End transformation methods -----------------
385 void setURLForRect(const KURL&, const IntRect&);
386 void setURLFragmentForRect(const String& name, const IntRect&);
387 void addURLTargetAtPoint(const String& name, const IntPoint&);
389 // Create an image buffer compatible with this context, with suitable resolution
390 // for drawing into the buffer and then into this context.
391 PassOwnPtr<ImageBuffer> createRasterBuffer(const IntSize&, OpacityMode = NonOpaque) const;
393 static void adjustLineToPixelBoundaries(FloatPoint& p1, FloatPoint& p2, float strokeWidth, StrokeStyle);
395 void beginAnnotation(const AnnotationList&);
396 void endAnnotation();
398 void preparePaintForDrawRectToRect(
400 const SkRect& srcRect,
401 const SkRect& destRect,
404 bool isBitmapWithAlpha,
405 bool isLazyDecoded = false,
406 bool isDataComplete = true) const;
408 static int focusRingOutsetExtent(int offset, int width)
410 return focusRingOutset(offset) + (focusRingWidth(width) + 1) / 2;
414 const GraphicsContextState* immutableState() const { return m_paintState; }
416 GraphicsContextState* mutableState()
422 static void setPathFromPoints(SkPath*, size_t, const FloatPoint*);
423 static void setRadii(SkVector*, IntSize, IntSize, IntSize, IntSize);
425 static PassRefPtr<SkColorFilter> WebCoreColorFilterToSkiaColorFilter(ColorFilter);
428 static inline int focusRingOutset(int offset) { return offset + 2; }
429 static inline int focusRingWidth(int width) { return width; }
431 static inline int focusRingOutset(int offset) { return 0; }
432 static inline int focusRingWidth(int width) { return 1; }
433 static SkPMColor lineColors(int);
434 static SkPMColor antiColors1(int);
435 static SkPMColor antiColors2(int);
436 static void draw1xMarker(SkBitmap*, int);
437 static void draw2xMarker(SkBitmap*, int);
440 void saveLayer(const SkRect* bounds, const SkPaint*);
443 // Helpers for drawing a focus ring (drawFocusRing)
444 float prepareFocusRingPaint(SkPaint&, const Color&, int width) const;
445 void drawFocusRingPath(const SkPath&, const Color&, int width);
446 void drawFocusRingRect(const SkRect&, const Color&, int width);
448 // SkCanvas wrappers.
449 void clipPath(const SkPath&, AntiAliasingMode = NotAntiAliased, SkRegion::Op = SkRegion::kIntersect_Op);
450 void clipRRect(const SkRRect&, AntiAliasingMode = NotAntiAliased, SkRegion::Op = SkRegion::kIntersect_Op);
451 void concat(const SkMatrix&);
452 void drawRRect(const SkRRect&, const SkPaint&);
454 void setDropShadowImageFilter(PassRefPtr<SkImageFilter>);
455 void clearDropShadowImageFilter();
456 SkImageFilter* dropShadowImageFilter() const { return immutableState()->dropShadowImageFilter(); }
458 // Apply deferred paint state saves
459 void realizePaintSave()
461 if (contextDisabled())
464 if (m_paintState->saveCount()) {
465 m_paintState->decrementSaveCount();
467 if (m_paintStateStack.size() == m_paintStateIndex) {
468 m_paintStateStack.append(GraphicsContextState::createAndCopy(*m_paintState));
469 m_paintState = m_paintStateStack[m_paintStateIndex].get();
471 GraphicsContextState* priorPaintState = m_paintState;
472 m_paintState = m_paintStateStack[m_paintStateIndex].get();
473 m_paintState->copy(*priorPaintState);
478 void didDrawTextInRect(const SkRect& textRect);
480 void fillRectWithRoundedHole(const IntRect&, const RoundedRect& roundedHoleRect, const Color&);
482 bool isRecording() const;
484 // null indicates painting is contextDisabled. Never delete this object.
487 // Paint states stack. Enables local drawing state change with save()/restore() calls.
488 // This state controls the appearance of drawn content.
489 // We do not delete from this stack to avoid memory churn.
490 Vector<OwnPtr<GraphicsContextState> > m_paintStateStack;
491 // Current index on the stack. May not be the last thing on the stack.
492 unsigned m_paintStateIndex;
493 // Raw pointer to the current state.
494 GraphicsContextState* m_paintState;
496 AnnotationModeFlags m_annotationMode;
498 struct RecordingState;
499 Vector<RecordingState> m_recordingStateStack;
502 unsigned m_annotationCount;
503 unsigned m_layerCount;
504 bool m_disableDestructionChecks;
506 // Tracks the region painted opaque via the GraphicsContext.
507 RegionTracker m_trackedRegion;
509 // Tracks the region where text is painted via the GraphicsContext.
512 unsigned m_disabledState;
514 float m_deviceScaleFactor;
516 // Activation for the above region tracking features
517 unsigned m_regionTrackingMode : 2;
518 unsigned m_trackTextRegion : 1;
520 unsigned m_accelerated : 1;
521 unsigned m_isCertainlyOpaque : 1;
522 unsigned m_printing : 1;
523 unsigned m_antialiasHairlineImages : 1;
524 unsigned m_shouldSmoothFonts : 1;
529 #endif // GraphicsContext_h