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

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

Issue 725913003: Fix stroke color definition of canvas context. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix typos in the test. Created 6 years, 1 month 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 | « LayoutTests/canvas/stroke-with-system-color-and-alpha-crash-expected.txt ('k') | no next file » | 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) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008 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 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 return nullptr; 141 return nullptr;
142 } 142 }
143 } 143 }
144 144
145 PassRefPtrWillBeRawPtr<CanvasStyle> CanvasStyle::createFromStringWithOverrideAlp ha(const String& color, float alpha) 145 PassRefPtrWillBeRawPtr<CanvasStyle> CanvasStyle::createFromStringWithOverrideAlp ha(const String& color, float alpha)
146 { 146 {
147 RGBA32 rgba; 147 RGBA32 rgba;
148 ColorParseResult parseResult = parseColor(rgba, color); 148 ColorParseResult parseResult = parseColor(rgba, color);
149 switch (parseResult) { 149 switch (parseResult) {
150 case ParsedRGBA: 150 case ParsedRGBA:
151 case ParsedSystemColor:
151 return adoptRefWillBeNoop(new CanvasStyle(colorWithOverrideAlpha(rgba, a lpha))); 152 return adoptRefWillBeNoop(new CanvasStyle(colorWithOverrideAlpha(rgba, a lpha)));
152 case ParsedCurrentColor: 153 case ParsedCurrentColor:
153 return adoptRefWillBeNoop(new CanvasStyle(CurrentColorWithOverrideAlpha, alpha)); 154 return adoptRefWillBeNoop(new CanvasStyle(CurrentColorWithOverrideAlpha, alpha));
154 case ParseFailed: 155 case ParseFailed:
155 return nullptr; 156 return nullptr;
156 default: 157 default:
157 ASSERT_NOT_REACHED(); 158 ASSERT_NOT_REACHED();
158 return nullptr; 159 return nullptr;
159 } 160 }
160 } 161 }
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 } 273 }
273 } 274 }
274 275
275 void CanvasStyle::trace(Visitor* visitor) 276 void CanvasStyle::trace(Visitor* visitor)
276 { 277 {
277 visitor->trace(m_gradient); 278 visitor->trace(m_gradient);
278 visitor->trace(m_pattern); 279 visitor->trace(m_pattern);
279 } 280 }
280 281
281 } 282 }
OLDNEW
« no previous file with comments | « LayoutTests/canvas/stroke-with-system-color-and-alpha-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698