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

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

Issue 13529026: Removing a bunch of unused platform code. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix whitespace and compiler error on Mac. Created 7 years, 8 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 | Annotate | Revision Log
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 25 matching lines...) Expand all
36 #include "GraphicsContext.h" 36 #include "GraphicsContext.h"
37 #include "HTMLCanvasElement.h" 37 #include "HTMLCanvasElement.h"
38 #include "StylePropertySet.h" 38 #include "StylePropertySet.h"
39 #include <wtf/Assertions.h> 39 #include <wtf/Assertions.h>
40 #include <wtf/PassRefPtr.h> 40 #include <wtf/PassRefPtr.h>
41 41
42 #if USE(CG) 42 #if USE(CG)
43 #include <CoreGraphics/CGContext.h> 43 #include <CoreGraphics/CGContext.h>
44 #endif 44 #endif
45 45
46 #if PLATFORM(QT)
47 #include <QPainter>
48 #include <QBrush>
49 #include <QPen>
50 #include <QColor>
51 #endif
52
53 namespace WebCore { 46 namespace WebCore {
54 47
55 enum ColorParseResult { ParsedRGBA, ParsedCurrentColor, ParsedSystemColor, Parse Failed }; 48 enum ColorParseResult { ParsedRGBA, ParsedCurrentColor, ParsedSystemColor, Parse Failed };
56 49
57 static ColorParseResult parseColor(RGBA32& parsedColor, const String& colorStrin g, Document* document = 0) 50 static ColorParseResult parseColor(RGBA32& parsedColor, const String& colorStrin g, Document* document = 0)
58 { 51 {
59 if (equalIgnoringCase(colorString, "currentcolor")) 52 if (equalIgnoringCase(colorString, "currentcolor"))
60 return ParsedCurrentColor; 53 return ParsedCurrentColor;
61 if (CSSParser::parseColor(parsedColor, colorString)) 54 if (CSSParser::parseColor(parsedColor, colorString))
62 return ParsedRGBA; 55 return ParsedRGBA;
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 return; 227 return;
235 switch (m_type) { 228 switch (m_type) {
236 case RGBA: 229 case RGBA:
237 context->setStrokeColor(m_rgba, ColorSpaceDeviceRGB); 230 context->setStrokeColor(m_rgba, ColorSpaceDeviceRGB);
238 break; 231 break;
239 case CMYKA: { 232 case CMYKA: {
240 // FIXME: Do this through platform-independent GraphicsContext API. 233 // FIXME: Do this through platform-independent GraphicsContext API.
241 // We'll need a fancier Color abstraction to support CMYKA correctly 234 // We'll need a fancier Color abstraction to support CMYKA correctly
242 #if USE(CG) 235 #if USE(CG)
243 CGContextSetCMYKStrokeColor(context->platformContext(), m_cmyka.c, m_cmy ka.m, m_cmyka.y, m_cmyka.k, m_cmyka.a); 236 CGContextSetCMYKStrokeColor(context->platformContext(), m_cmyka.c, m_cmy ka.m, m_cmyka.y, m_cmyka.k, m_cmyka.a);
244 #elif PLATFORM(QT)
245 QPen currentPen = context->platformContext()->pen();
246 QColor clr;
247 clr.setCmykF(m_cmyka.c, m_cmyka.m, m_cmyka.y, m_cmyka.k, m_cmyka.a);
248 currentPen.setColor(clr);
249 context->platformContext()->setPen(currentPen);
250 #else 237 #else
251 context->setStrokeColor(m_rgba, ColorSpaceDeviceRGB); 238 context->setStrokeColor(m_rgba, ColorSpaceDeviceRGB);
252 #endif 239 #endif
253 break; 240 break;
254 } 241 }
255 case Gradient: 242 case Gradient:
256 context->setStrokeGradient(canvasGradient()->gradient()); 243 context->setStrokeGradient(canvasGradient()->gradient());
257 break; 244 break;
258 case ImagePattern: 245 case ImagePattern:
259 context->setStrokePattern(canvasPattern()->pattern()); 246 context->setStrokePattern(canvasPattern()->pattern());
(...skipping 11 matching lines...) Expand all
271 return; 258 return;
272 switch (m_type) { 259 switch (m_type) {
273 case RGBA: 260 case RGBA:
274 context->setFillColor(m_rgba, ColorSpaceDeviceRGB); 261 context->setFillColor(m_rgba, ColorSpaceDeviceRGB);
275 break; 262 break;
276 case CMYKA: { 263 case CMYKA: {
277 // FIXME: Do this through platform-independent GraphicsContext API. 264 // FIXME: Do this through platform-independent GraphicsContext API.
278 // We'll need a fancier Color abstraction to support CMYKA correctly 265 // We'll need a fancier Color abstraction to support CMYKA correctly
279 #if USE(CG) 266 #if USE(CG)
280 CGContextSetCMYKFillColor(context->platformContext(), m_cmyka.c, m_cmyka .m, m_cmyka.y, m_cmyka.k, m_cmyka.a); 267 CGContextSetCMYKFillColor(context->platformContext(), m_cmyka.c, m_cmyka .m, m_cmyka.y, m_cmyka.k, m_cmyka.a);
281 #elif PLATFORM(QT)
282 QBrush currentBrush = context->platformContext()->brush();
283 QColor clr;
284 clr.setCmykF(m_cmyka.c, m_cmyka.m, m_cmyka.y, m_cmyka.k, m_cmyka.a);
285 currentBrush.setColor(clr);
286 context->platformContext()->setBrush(currentBrush);
287 #else 268 #else
288 context->setFillColor(m_rgba, ColorSpaceDeviceRGB); 269 context->setFillColor(m_rgba, ColorSpaceDeviceRGB);
289 #endif 270 #endif
290 break; 271 break;
291 } 272 }
292 case Gradient: 273 case Gradient:
293 context->setFillGradient(canvasGradient()->gradient()); 274 context->setFillGradient(canvasGradient()->gradient());
294 break; 275 break;
295 case ImagePattern: 276 case ImagePattern:
296 context->setFillPattern(canvasPattern()->pattern()); 277 context->setFillPattern(canvasPattern()->pattern());
297 break; 278 break;
298 case CurrentColor: 279 case CurrentColor:
299 case CurrentColorWithOverrideAlpha: 280 case CurrentColorWithOverrideAlpha:
300 ASSERT_NOT_REACHED(); 281 ASSERT_NOT_REACHED();
301 break; 282 break;
302 } 283 }
303 } 284 }
304 285
305 } 286 }
OLDNEW
« no previous file with comments | « Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp ('k') | Source/WebCore/html/canvas/WebGLContextGroup.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698