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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 | 233 |
234 // Get the current stroke style. | 234 // Get the current stroke style. |
235 const SkPaint& strokePaint() const { return immutableState()->strokePaint();
} | 235 const SkPaint& strokePaint() const { return immutableState()->strokePaint();
} |
236 | 236 |
237 // These draw methods will do both stroking and filling. | 237 // These draw methods will do both stroking and filling. |
238 // FIXME: ...except drawRect(), which fills properly but always strokes | 238 // FIXME: ...except drawRect(), which fills properly but always strokes |
239 // using a 1-pixel stroke inset from the rect borders (of the correct | 239 // using a 1-pixel stroke inset from the rect borders (of the correct |
240 // stroke color). | 240 // stroke color). |
241 void drawRect(const IntRect&); | 241 void drawRect(const IntRect&); |
242 void drawLine(const IntPoint&, const IntPoint&); | 242 void drawLine(const IntPoint&, const IntPoint&); |
243 void drawConvexPolygon(size_t numPoints, const FloatPoint*, bool shouldAntia
lias = false); | 243 |
| 244 void fillPolygon(size_t numPoints, const FloatPoint*, const Color&, bool sho
uldAntialias); |
244 | 245 |
245 void fillPath(const Path&); | 246 void fillPath(const Path&); |
246 void strokePath(const Path&); | 247 void strokePath(const Path&); |
247 | 248 |
248 void fillEllipse(const FloatRect&); | 249 void fillEllipse(const FloatRect&); |
249 void strokeEllipse(const FloatRect&); | 250 void strokeEllipse(const FloatRect&); |
250 | 251 |
251 void fillRect(const FloatRect&); | 252 void fillRect(const FloatRect&); |
252 void fillRect(const FloatRect&, const Color&); | 253 void fillRect(const FloatRect&, const Color&); |
253 void fillRect(const FloatRect&, const Color&, CompositeOperator); | 254 void fillRect(const FloatRect&, const Color&, CompositeOperator); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 void drawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[]
, SkScalar constY, const SkRect& textRect, const SkPaint&); | 300 void drawPosTextH(const void* text, size_t byteLength, const SkScalar xpos[]
, SkScalar constY, const SkRect& textRect, const SkPaint&); |
300 void drawTextBlob(const SkTextBlob*, const SkPoint& origin, const SkPaint&); | 301 void drawTextBlob(const SkTextBlob*, const SkPoint& origin, const SkPaint&); |
301 | 302 |
302 void clip(const IntRect& rect) { clipRect(rect); } | 303 void clip(const IntRect& rect) { clipRect(rect); } |
303 void clip(const FloatRect& rect) { clipRect(rect); } | 304 void clip(const FloatRect& rect) { clipRect(rect); } |
304 void clipRoundedRect(const RoundedRect&, SkRegion::Op = SkRegion::kIntersect
_Op); | 305 void clipRoundedRect(const RoundedRect&, SkRegion::Op = SkRegion::kIntersect
_Op); |
305 void clipOut(const IntRect& rect) { clipRect(rect, NotAntiAliased, SkRegion:
:kDifference_Op); } | 306 void clipOut(const IntRect& rect) { clipRect(rect, NotAntiAliased, SkRegion:
:kDifference_Op); } |
306 void clipOut(const Path&); | 307 void clipOut(const Path&); |
307 void clipOutRoundedRect(const RoundedRect&); | 308 void clipOutRoundedRect(const RoundedRect&); |
308 void clipPath(const Path&, WindRule = RULE_EVENODD); | 309 void clipPath(const Path&, WindRule = RULE_EVENODD); |
309 void clipConvexPolygon(size_t numPoints, const FloatPoint*, bool antialias =
true); | 310 void clipPolygon(size_t numPoints, const FloatPoint*, bool antialias); |
310 void clipRect(const SkRect&, AntiAliasingMode = NotAntiAliased, SkRegion::Op
= SkRegion::kIntersect_Op); | 311 void clipRect(const SkRect&, AntiAliasingMode = NotAntiAliased, SkRegion::Op
= SkRegion::kIntersect_Op); |
311 // This clip function is used only by <canvas> code. It allows | 312 // This clip function is used only by <canvas> code. It allows |
312 // implementations to handle clipping on the canvas differently since | 313 // implementations to handle clipping on the canvas differently since |
313 // the discipline is different. | 314 // the discipline is different. |
314 void canvasClip(const Path&, WindRule = RULE_EVENODD); | 315 void canvasClip(const Path&, WindRule = RULE_EVENODD); |
315 | 316 |
316 void drawText(const Font&, const TextRunPaintInfo&, const FloatPoint&); | 317 void drawText(const Font&, const TextRunPaintInfo&, const FloatPoint&); |
317 void drawEmphasisMarks(const Font&, const TextRunPaintInfo&, const AtomicStr
ing& mark, const FloatPoint&); | 318 void drawEmphasisMarks(const Font&, const TextRunPaintInfo&, const AtomicStr
ing& mark, const FloatPoint&); |
318 void drawBidiText(const Font&, const TextRunPaintInfo&, const FloatPoint&, F
ont::CustomFontNotReadyAction = Font::DoNotPaintIfFontNotReady); | 319 void drawBidiText(const Font&, const TextRunPaintInfo&, const FloatPoint&, F
ont::CustomFontNotReadyAction = Font::DoNotPaintIfFontNotReady); |
319 void drawHighlightForText(const Font&, const TextRun&, const FloatPoint&, in
t h, const Color& backgroundColor, int from = 0, int to = -1); | 320 void drawHighlightForText(const Font&, const TextRun&, const FloatPoint&, in
t h, const Color& backgroundColor, int from = 0, int to = -1); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 | 412 |
412 private: | 413 private: |
413 const GraphicsContextState* immutableState() const { return m_paintState; } | 414 const GraphicsContextState* immutableState() const { return m_paintState; } |
414 | 415 |
415 GraphicsContextState* mutableState() | 416 GraphicsContextState* mutableState() |
416 { | 417 { |
417 realizePaintSave(); | 418 realizePaintSave(); |
418 return m_paintState; | 419 return m_paintState; |
419 } | 420 } |
420 | 421 |
421 static void setPathFromConvexPoints(SkPath*, size_t, const FloatPoint*); | 422 static void setPathFromPoints(SkPath*, size_t, const FloatPoint*); |
422 static void setRadii(SkVector*, IntSize, IntSize, IntSize, IntSize); | 423 static void setRadii(SkVector*, IntSize, IntSize, IntSize, IntSize); |
423 | 424 |
424 static PassRefPtr<SkColorFilter> WebCoreColorFilterToSkiaColorFilter(ColorFi
lter); | 425 static PassRefPtr<SkColorFilter> WebCoreColorFilterToSkiaColorFilter(ColorFi
lter); |
425 | 426 |
426 #if OS(MACOSX) | 427 #if OS(MACOSX) |
427 static inline int focusRingOutset(int offset) { return offset + 2; } | 428 static inline int focusRingOutset(int offset) { return offset + 2; } |
428 static inline int focusRingWidth(int width) { return width; } | 429 static inline int focusRingWidth(int width) { return width; } |
429 #else | 430 #else |
430 static inline int focusRingOutset(int offset) { return 0; } | 431 static inline int focusRingOutset(int offset) { return 0; } |
431 static inline int focusRingWidth(int width) { return 1; } | 432 static inline int focusRingWidth(int width) { return 1; } |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 bool m_accelerated : 1; | 513 bool m_accelerated : 1; |
513 bool m_isCertainlyOpaque : 1; | 514 bool m_isCertainlyOpaque : 1; |
514 bool m_printing : 1; | 515 bool m_printing : 1; |
515 bool m_antialiasHairlineImages : 1; | 516 bool m_antialiasHairlineImages : 1; |
516 bool m_shouldSmoothFonts : 1; | 517 bool m_shouldSmoothFonts : 1; |
517 }; | 518 }; |
518 | 519 |
519 } // namespace blink | 520 } // namespace blink |
520 | 521 |
521 #endif // GraphicsContext_h | 522 #endif // GraphicsContext_h |
OLD | NEW |