Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(882)

Side by Side Diff: Source/core/html/canvas/CanvasRenderingContext2D.h

Issue 652483003: Plumb in flag to enable antialiased clipping in HTML 5 Canvas (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: More cleanup Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2009, 2010, 2011, 2012 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2009, 2010, 2011, 2012 Apple Inc. All rights reserv ed.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 class HTMLImageElement; 62 class HTMLImageElement;
63 class HTMLVideoElement; 63 class HTMLVideoElement;
64 class ImageData; 64 class ImageData;
65 class TextMetrics; 65 class TextMetrics;
66 66
67 typedef WillBeHeapHashMap<String, RefPtrWillBeMember<MutableStylePropertySet> > MutableStylePropertyMap; 67 typedef WillBeHeapHashMap<String, RefPtrWillBeMember<MutableStylePropertySet> > MutableStylePropertyMap;
68 68
69 class CanvasRenderingContext2D final: public CanvasRenderingContext, public Scri ptWrappable, public CanvasPathMethods { 69 class CanvasRenderingContext2D final: public CanvasRenderingContext, public Scri ptWrappable, public CanvasPathMethods {
70 DEFINE_WRAPPERTYPEINFO(); 70 DEFINE_WRAPPERTYPEINFO();
71 public: 71 public:
72 static PassOwnPtrWillBeRawPtr<CanvasRenderingContext2D> create(HTMLCanvasEle ment* canvas, const Canvas2DContextAttributes* attrs, bool usesCSSCompatibilityP arseMode) 72 static PassOwnPtrWillBeRawPtr<CanvasRenderingContext2D> create(HTMLCanvasEle ment* canvas, const Canvas2DContextAttributes* attrs, bool usesCSSCompatibilityP arseMode, bool antialiasClips)
73 { 73 {
74 return adoptPtrWillBeNoop(new CanvasRenderingContext2D(canvas, attrs, us esCSSCompatibilityParseMode)); 74 return adoptPtrWillBeNoop(new CanvasRenderingContext2D(canvas, attrs, us esCSSCompatibilityParseMode, antialiasClips));
75 } 75 }
76 virtual ~CanvasRenderingContext2D(); 76 virtual ~CanvasRenderingContext2D();
77 77
78 CanvasStyle* strokeStyle() const; 78 CanvasStyle* strokeStyle() const;
79 void setStrokeStyle(PassRefPtrWillBeRawPtr<CanvasStyle>); 79 void setStrokeStyle(PassRefPtrWillBeRawPtr<CanvasStyle>);
80 80
81 CanvasStyle* fillStyle() const; 81 CanvasStyle* fillStyle() const;
82 void setFillStyle(PassRefPtrWillBeRawPtr<CanvasStyle>); 82 void setFillStyle(PassRefPtrWillBeRawPtr<CanvasStyle>);
83 83
84 float lineWidth() const; 84 float lineWidth() const;
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 TextBaseline m_textBaseline; 290 TextBaseline m_textBaseline;
291 Direction m_direction; 291 Direction m_direction;
292 292
293 String m_unparsedFont; 293 String m_unparsedFont;
294 Font m_font; 294 Font m_font;
295 bool m_realizedFont; 295 bool m_realizedFont;
296 296
297 bool m_hasClip; 297 bool m_hasClip;
298 }; 298 };
299 299
300 CanvasRenderingContext2D(HTMLCanvasElement*, const Canvas2DContextAttributes * attrs, bool usesCSSCompatibilityParseMode); 300 CanvasRenderingContext2D(HTMLCanvasElement*, const Canvas2DContextAttributes * attrs, bool usesCSSCompatibilityParseMode, bool antialiasClips);
301 301
302 State& modifiableState() { ASSERT(!state().m_unrealizedSaveCount); return *m _stateStack.last(); } 302 State& modifiableState() { ASSERT(!state().m_unrealizedSaveCount); return *m _stateStack.last(); }
303 const State& state() const { return *m_stateStack.last(); } 303 const State& state() const { return *m_stateStack.last(); }
304 304
305 void applyLineDash() const; 305 void applyLineDash() const;
306 void setShadow(const FloatSize& offset, float blur, RGBA32 color); 306 void setShadow(const FloatSize& offset, float blur, RGBA32 color);
307 void applyShadow(); 307 void applyShadow();
308 bool shouldDrawShadows() const; 308 bool shouldDrawShadows() const;
309 309
310 void dispatchContextLostEvent(Timer<CanvasRenderingContext2D>*); 310 void dispatchContextLostEvent(Timer<CanvasRenderingContext2D>*);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 virtual void setIsHidden(bool) override; 362 virtual void setIsHidden(bool) override;
363 363
364 virtual bool isTransformInvertible() const override { return state().m_inver tibleCTM; } 364 virtual bool isTransformInvertible() const override { return state().m_inver tibleCTM; }
365 365
366 virtual blink::WebLayer* platformLayer() const override; 366 virtual blink::WebLayer* platformLayer() const override;
367 TextDirection toTextDirection(Direction, RenderStyle** computedStyle = nullp tr) const; 367 TextDirection toTextDirection(Direction, RenderStyle** computedStyle = nullp tr) const;
368 368
369 WillBeHeapVector<OwnPtrWillBeMember<State> > m_stateStack; 369 WillBeHeapVector<OwnPtrWillBeMember<State> > m_stateStack;
370 OwnPtrWillBeMember<HitRegionManager> m_hitRegionManager; 370 OwnPtrWillBeMember<HitRegionManager> m_hitRegionManager;
371 bool m_usesCSSCompatibilityParseMode; 371 bool m_usesCSSCompatibilityParseMode;
372 bool m_antialiasClips;
372 bool m_hasAlpha; 373 bool m_hasAlpha;
373 bool m_isContextLost; 374 bool m_isContextLost;
374 bool m_contextRestorable; 375 bool m_contextRestorable;
375 Canvas2DContextStorage m_storageMode; 376 Canvas2DContextStorage m_storageMode;
376 MutableStylePropertyMap m_fetchedFonts; 377 MutableStylePropertyMap m_fetchedFonts;
377 ListHashSet<String> m_fetchedFontsLRUList; 378 ListHashSet<String> m_fetchedFontsLRUList;
378 unsigned m_tryRestoreContextAttemptCount; 379 unsigned m_tryRestoreContextAttemptCount;
379 Timer<CanvasRenderingContext2D> m_dispatchContextLostEventTimer; 380 Timer<CanvasRenderingContext2D> m_dispatchContextLostEventTimer;
380 Timer<CanvasRenderingContext2D> m_dispatchContextRestoredEventTimer; 381 Timer<CanvasRenderingContext2D> m_dispatchContextRestoredEventTimer;
381 Timer<CanvasRenderingContext2D> m_tryRestoreContextEventTimer; 382 Timer<CanvasRenderingContext2D> m_tryRestoreContextEventTimer;
382 }; 383 };
383 384
384 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, con text->is2d(), context.is2d()); 385 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, con text->is2d(), context.is2d());
385 386
386 } // namespace blink 387 } // namespace blink
387 388
388 #endif // CanvasRenderingContext2D_h 389 #endif // CanvasRenderingContext2D_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698