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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
230 void ClipOut(const Path&); | 230 void ClipOut(const Path&); |
231 void ClipOutRoundedRect(const FloatRoundedRect&); | 231 void ClipOutRoundedRect(const FloatRoundedRect&); |
232 void ClipPath(const SkPath&, | 232 void ClipPath(const SkPath&, |
233 AntiAliasingMode = kNotAntiAliased, | 233 AntiAliasingMode = kNotAntiAliased, |
234 SkClipOp = SkClipOp::kIntersect); | 234 SkClipOp = SkClipOp::kIntersect); |
235 void ClipRect(const SkRect&, | 235 void ClipRect(const SkRect&, |
236 AntiAliasingMode = kNotAntiAliased, | 236 AntiAliasingMode = kNotAntiAliased, |
237 SkClipOp = SkClipOp::kIntersect); | 237 SkClipOp = SkClipOp::kIntersect); |
238 | 238 |
239 void DrawText(const Font&, const TextRunPaintInfo&, const FloatPoint&); | 239 void DrawText(const Font&, const TextRunPaintInfo&, const FloatPoint&); |
240 void DrawText(const Font&, const TextFragmentPaintInfo&, const FloatPoint&); | |
eae
2017/04/27 03:30:32
I tried templetazing the public methods themselves
| |
241 | |
240 void DrawText(const Font&, | 242 void DrawText(const Font&, |
241 const TextRunPaintInfo&, | 243 const TextRunPaintInfo&, |
242 const FloatPoint&, | 244 const FloatPoint&, |
243 const PaintFlags&); | 245 const PaintFlags&); |
246 void DrawText(const Font&, | |
247 const TextFragmentPaintInfo&, | |
248 const FloatPoint&, | |
249 const PaintFlags&); | |
250 | |
244 void DrawEmphasisMarks(const Font&, | 251 void DrawEmphasisMarks(const Font&, |
245 const TextRunPaintInfo&, | 252 const TextRunPaintInfo&, |
246 const AtomicString& mark, | 253 const AtomicString& mark, |
247 const FloatPoint&); | 254 const FloatPoint&); |
255 void DrawEmphasisMarks(const Font&, | |
256 const TextFragmentPaintInfo&, | |
257 const AtomicString& mark, | |
258 const FloatPoint&); | |
259 | |
248 void DrawBidiText( | 260 void DrawBidiText( |
249 const Font&, | 261 const Font&, |
250 const TextRunPaintInfo&, | 262 const TextRunPaintInfo&, |
251 const FloatPoint&, | 263 const FloatPoint&, |
252 Font::CustomFontNotReadyAction = Font::kDoNotPaintIfFontNotReady); | 264 Font::CustomFontNotReadyAction = Font::kDoNotPaintIfFontNotReady); |
253 void DrawHighlightForText(const Font&, | 265 void DrawHighlightForText(const Font&, |
254 const TextRun&, | 266 const TextRun&, |
255 const FloatPoint&, | 267 const FloatPoint&, |
256 int h, | 268 int h, |
257 const Color& background_color, | 269 const Color& background_color, |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
363 static sk_sp<SkColorFilter> WebCoreColorFilterToSkiaColorFilter(ColorFilter); | 375 static sk_sp<SkColorFilter> WebCoreColorFilterToSkiaColorFilter(ColorFilter); |
364 | 376 |
365 private: | 377 private: |
366 const GraphicsContextState* ImmutableState() const { return paint_state_; } | 378 const GraphicsContextState* ImmutableState() const { return paint_state_; } |
367 | 379 |
368 GraphicsContextState* MutableState() { | 380 GraphicsContextState* MutableState() { |
369 RealizePaintSave(); | 381 RealizePaintSave(); |
370 return paint_state_; | 382 return paint_state_; |
371 } | 383 } |
372 | 384 |
385 template <typename TextPaintInfo> | |
386 void DrawTextInternal(const Font&, | |
387 const TextPaintInfo&, | |
388 const FloatPoint&, | |
389 const PaintFlags&); | |
390 | |
391 template <typename TextPaintInfo> | |
392 void DrawTextInternal(const Font&, const TextPaintInfo&, const FloatPoint&); | |
393 | |
394 template <typename TextPaintInfo> | |
395 void DrawEmphasisMarksInternal(const Font&, | |
396 const TextPaintInfo&, | |
397 const AtomicString& mark, | |
398 const FloatPoint&); | |
399 | |
373 template <typename DrawTextFunc> | 400 template <typename DrawTextFunc> |
374 void DrawTextPasses(const DrawTextFunc&); | 401 void DrawTextPasses(const DrawTextFunc&); |
375 | 402 |
376 void SaveLayer(const SkRect* bounds, const PaintFlags*); | 403 void SaveLayer(const SkRect* bounds, const PaintFlags*); |
377 void RestoreLayer(); | 404 void RestoreLayer(); |
378 | 405 |
379 // Helpers for drawing a focus ring (drawFocusRing) | 406 // Helpers for drawing a focus ring (drawFocusRing) |
380 void DrawFocusRingPath(const SkPath&, const Color&, float width); | 407 void DrawFocusRingPath(const SkPath&, const Color&, float width); |
381 void DrawFocusRingRect(const SkRect&, const Color&, float width); | 408 void DrawFocusRingRect(const SkRect&, const Color&, float width); |
382 | 409 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
442 | 469 |
443 float device_scale_factor_; | 470 float device_scale_factor_; |
444 | 471 |
445 unsigned printing_ : 1; | 472 unsigned printing_ : 1; |
446 unsigned has_meta_data_ : 1; | 473 unsigned has_meta_data_ : 1; |
447 }; | 474 }; |
448 | 475 |
449 } // namespace blink | 476 } // namespace blink |
450 | 477 |
451 #endif // GraphicsContext_h | 478 #endif // GraphicsContext_h |
OLD | NEW |