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

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

Issue 196093002: Remove document param from parseSystemColor (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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
« no previous file with comments | « Source/core/css/parser/BisonCSSParser-in.cpp ('k') | Source/core/html/canvas/CanvasStyle.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 736
737 resetTransform(); 737 resetTransform();
738 transform(m11, m12, m21, m22, dx, dy); 738 transform(m11, m12, m21, m22, dx, dy);
739 } 739 }
740 740
741 void CanvasRenderingContext2D::setStrokeColor(const String& color) 741 void CanvasRenderingContext2D::setStrokeColor(const String& color)
742 { 742 {
743 if (color == state().m_unparsedStrokeColor) 743 if (color == state().m_unparsedStrokeColor)
744 return; 744 return;
745 realizeSaves(); 745 realizeSaves();
746 setStrokeStyle(CanvasStyle::createFromString(color, &canvas()->document())); 746 setStrokeStyle(CanvasStyle::createFromString(color));
747 modifiableState().m_unparsedStrokeColor = color; 747 modifiableState().m_unparsedStrokeColor = color;
748 } 748 }
749 749
750 void CanvasRenderingContext2D::setStrokeColor(float grayLevel) 750 void CanvasRenderingContext2D::setStrokeColor(float grayLevel)
751 { 751 {
752 if (state().m_strokeStyle && state().m_strokeStyle->isEquivalentRGBA(grayLev el, grayLevel, grayLevel, 1.0f)) 752 if (state().m_strokeStyle && state().m_strokeStyle->isEquivalentRGBA(grayLev el, grayLevel, grayLevel, 1.0f))
753 return; 753 return;
754 setStrokeStyle(CanvasStyle::createFromGrayLevelWithAlpha(grayLevel, 1.0f)); 754 setStrokeStyle(CanvasStyle::createFromGrayLevelWithAlpha(grayLevel, 1.0f));
755 } 755 }
756 756
(...skipping 21 matching lines...) Expand all
778 if (state().m_strokeStyle && state().m_strokeStyle->isEquivalentCMYKA(c, m, y, k, a)) 778 if (state().m_strokeStyle && state().m_strokeStyle->isEquivalentCMYKA(c, m, y, k, a))
779 return; 779 return;
780 setStrokeStyle(CanvasStyle::createFromCMYKAChannels(c, m, y, k, a)); 780 setStrokeStyle(CanvasStyle::createFromCMYKAChannels(c, m, y, k, a));
781 } 781 }
782 782
783 void CanvasRenderingContext2D::setFillColor(const String& color) 783 void CanvasRenderingContext2D::setFillColor(const String& color)
784 { 784 {
785 if (color == state().m_unparsedFillColor) 785 if (color == state().m_unparsedFillColor)
786 return; 786 return;
787 realizeSaves(); 787 realizeSaves();
788 setFillStyle(CanvasStyle::createFromString(color, &canvas()->document())); 788 setFillStyle(CanvasStyle::createFromString(color));
789 modifiableState().m_unparsedFillColor = color; 789 modifiableState().m_unparsedFillColor = color;
790 } 790 }
791 791
792 void CanvasRenderingContext2D::setFillColor(float grayLevel) 792 void CanvasRenderingContext2D::setFillColor(float grayLevel)
793 { 793 {
794 if (state().m_fillStyle && state().m_fillStyle->isEquivalentRGBA(grayLevel, grayLevel, grayLevel, 1.0f)) 794 if (state().m_fillStyle && state().m_fillStyle->isEquivalentRGBA(grayLevel, grayLevel, grayLevel, 1.0f))
795 return; 795 return;
796 setFillStyle(CanvasStyle::createFromGrayLevelWithAlpha(grayLevel, 1.0f)); 796 setFillStyle(CanvasStyle::createFromGrayLevelWithAlpha(grayLevel, 1.0f));
797 } 797 }
798 798
(...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after
2300 const int focusRingWidth = 5; 2300 const int focusRingWidth = 5;
2301 const int focusRingOutline = 0; 2301 const int focusRingOutline = 0;
2302 c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor); 2302 c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor);
2303 2303
2304 c->restore(); 2304 c->restore();
2305 2305
2306 didDraw(dirtyRect); 2306 didDraw(dirtyRect);
2307 } 2307 }
2308 2308
2309 } // namespace WebCore 2309 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/parser/BisonCSSParser-in.cpp ('k') | Source/core/html/canvas/CanvasStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698