OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 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 * | 7 * |
8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
10 * are met: | 10 * are met: |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 | 860 |
861 void CanvasRenderingContext2D::setShadow(float width, float height, float blur,
float c, float m, float y, float k, float a) | 861 void CanvasRenderingContext2D::setShadow(float width, float height, float blur,
float c, float m, float y, float k, float a) |
862 { | 862 { |
863 state().m_shadowOffset = FloatSize(width, height); | 863 state().m_shadowOffset = FloatSize(width, height); |
864 state().m_shadowBlur = blur; | 864 state().m_shadowBlur = blur; |
865 state().m_shadowColor = ""; | 865 state().m_shadowColor = ""; |
866 | 866 |
867 GraphicsContext* dc = drawingContext(); | 867 GraphicsContext* dc = drawingContext(); |
868 if (!dc) | 868 if (!dc) |
869 return; | 869 return; |
870 // FIXME: Do this through platform-independent GraphicsContext API. | |
871 #if PLATFORM(CG) | 870 #if PLATFORM(CG) |
872 const CGFloat components[5] = { c, m, y, k, a }; | 871 const CGFloat components[5] = { c, m, y, k, a }; |
873 CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceCMYK(); | 872 CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceCMYK(); |
874 CGColorRef shadowColor = CGColorCreate(colorSpace, components); | 873 CGColorRef shadowColor = CGColorCreate(colorSpace, components); |
875 CGColorSpaceRelease(colorSpace); | 874 CGColorSpaceRelease(colorSpace); |
876 CGContextSetShadowWithColor(dc->platformContext(), adjustedShadowSize(width,
-height), blur, shadowColor); | 875 CGContextSetShadowWithColor(dc->platformContext(), adjustedShadowSize(width,
-height), blur, shadowColor); |
877 CGColorRelease(shadowColor); | 876 CGColorRelease(shadowColor); |
| 877 #else |
| 878 dc->setShadow(IntSize(width, -height), blur, Color(c, m, y, k, a)); |
878 #endif | 879 #endif |
879 } | 880 } |
880 | 881 |
881 void CanvasRenderingContext2D::clearShadow() | 882 void CanvasRenderingContext2D::clearShadow() |
882 { | 883 { |
883 state().m_shadowOffset = FloatSize(); | 884 state().m_shadowOffset = FloatSize(); |
884 state().m_shadowBlur = 0; | 885 state().m_shadowBlur = 0; |
885 state().m_shadowColor = ""; | 886 state().m_shadowColor = ""; |
886 applyShadow(); | 887 applyShadow(); |
887 } | 888 } |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1451 } | 1452 } |
1452 | 1453 |
1453 const Font& CanvasRenderingContext2D::accessFont() | 1454 const Font& CanvasRenderingContext2D::accessFont() |
1454 { | 1455 { |
1455 if (!state().m_realizedFont) | 1456 if (!state().m_realizedFont) |
1456 setFont(state().m_unparsedFont); | 1457 setFont(state().m_unparsedFont); |
1457 return state().m_font; | 1458 return state().m_font; |
1458 } | 1459 } |
1459 | 1460 |
1460 } // namespace WebCore | 1461 } // namespace WebCore |
OLD | NEW |