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

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

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) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 4 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. 8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved.
9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
10 * 10 *
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 static const char ltr[] = "ltr"; 80 static const char ltr[] = "ltr";
81 static const double TryRestoreContextInterval = 0.5; 81 static const double TryRestoreContextInterval = 0.5;
82 static const unsigned MaxTryRestoreContextAttempts = 4; 82 static const unsigned MaxTryRestoreContextAttempts = 4;
83 static const unsigned FetchedFontsCacheLimit = 50; 83 static const unsigned FetchedFontsCacheLimit = 50;
84 84
85 static bool contextLostRestoredEventsEnabled() 85 static bool contextLostRestoredEventsEnabled()
86 { 86 {
87 return RuntimeEnabledFeatures::experimentalCanvasFeaturesEnabled(); 87 return RuntimeEnabledFeatures::experimentalCanvasFeaturesEnabled();
88 } 88 }
89 89
90 CanvasRenderingContext2D::CanvasRenderingContext2D(HTMLCanvasElement* canvas, co nst Canvas2DContextAttributes* attrs, bool usesCSSCompatibilityParseMode) 90 CanvasRenderingContext2D::CanvasRenderingContext2D(HTMLCanvasElement* canvas, co nst Canvas2DContextAttributes* attrs, bool usesCSSCompatibilityParseMode, bool a ntialiasClips)
91 : CanvasRenderingContext(canvas) 91 : CanvasRenderingContext(canvas)
92 , m_usesCSSCompatibilityParseMode(usesCSSCompatibilityParseMode) 92 , m_usesCSSCompatibilityParseMode(usesCSSCompatibilityParseMode)
93 , m_antialiasClips(antialiasClips)
93 , m_hasAlpha(!attrs || attrs->alpha()) 94 , m_hasAlpha(!attrs || attrs->alpha())
94 , m_isContextLost(false) 95 , m_isContextLost(false)
95 , m_contextRestorable(true) 96 , m_contextRestorable(true)
96 , m_storageMode(!attrs ? PersistentStorage : attrs->parsedStorage()) 97 , m_storageMode(!attrs ? PersistentStorage : attrs->parsedStorage())
97 , m_tryRestoreContextAttemptCount(0) 98 , m_tryRestoreContextAttemptCount(0)
98 , m_dispatchContextLostEventTimer(this, &CanvasRenderingContext2D::dispatchC ontextLostEvent) 99 , m_dispatchContextLostEventTimer(this, &CanvasRenderingContext2D::dispatchC ontextLostEvent)
99 , m_dispatchContextRestoredEventTimer(this, &CanvasRenderingContext2D::dispa tchContextRestoredEvent) 100 , m_dispatchContextRestoredEventTimer(this, &CanvasRenderingContext2D::dispa tchContextRestoredEvent)
100 , m_tryRestoreContextEventTimer(this, &CanvasRenderingContext2D::tryRestoreC ontextEvent) 101 , m_tryRestoreContextEventTimer(this, &CanvasRenderingContext2D::tryRestoreC ontextEvent)
101 { 102 {
102 m_stateStack.append(adoptPtrWillBeNoop(new State())); 103 m_stateStack.append(adoptPtrWillBeNoop(new State()));
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 { 1107 {
1107 GraphicsContext* c = drawingContext(); 1108 GraphicsContext* c = drawingContext();
1108 if (!c) { 1109 if (!c) {
1109 return; 1110 return;
1110 } 1111 }
1111 if (!state().m_invertibleCTM) { 1112 if (!state().m_invertibleCTM) {
1112 return; 1113 return;
1113 } 1114 }
1114 1115
1115 realizeSaves(c); 1116 realizeSaves(c);
1116 c->canvasClip(path, parseWinding(windingRuleString)); 1117 c->canvasClip(path, parseWinding(windingRuleString), m_antialiasClips);
1117 modifiableState().m_hasClip = true; 1118 modifiableState().m_hasClip = true;
1118 } 1119 }
1119 1120
1120 void CanvasRenderingContext2D::clip(const String& windingRuleString) 1121 void CanvasRenderingContext2D::clip(const String& windingRuleString)
1121 { 1122 {
1122 clipInternal(m_path, windingRuleString); 1123 clipInternal(m_path, windingRuleString);
1123 } 1124 }
1124 1125
1125 void CanvasRenderingContext2D::clip(Path2D* domPath, const String& windingRuleSt ring) 1126 void CanvasRenderingContext2D::clip(Path2D* domPath, const String& windingRuleSt ring)
1126 { 1127 {
(...skipping 1336 matching lines...) Expand 10 before | Expand all | Expand 10 after
2463 2464
2464 unsigned CanvasRenderingContext2D::hitRegionsCount() const 2465 unsigned CanvasRenderingContext2D::hitRegionsCount() const
2465 { 2466 {
2466 if (m_hitRegionManager) 2467 if (m_hitRegionManager)
2467 return m_hitRegionManager->getHitRegionsCount(); 2468 return m_hitRegionManager->getHitRegionsCount();
2468 2469
2469 return 0; 2470 return 0;
2470 } 2471 }
2471 2472
2472 } // namespace blink 2473 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698