OLD | NEW |
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 Intel Corporation. All rights reserved. | 8 * Copyright (C) 2012 Intel Corporation. All rights reserved. |
9 * | 9 * |
10 * Redistribution and use in source and binary forms, with or without | 10 * Redistribution and use in source and binary forms, with or without |
(...skipping 2342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2353 else if (state().m_lineCap == SquareCap) | 2353 else if (state().m_lineCap == SquareCap) |
2354 delta *= root2; | 2354 delta *= root2; |
2355 | 2355 |
2356 rect.inflate(delta); | 2356 rect.inflate(delta); |
2357 } | 2357 } |
2358 | 2358 |
2359 const Font& CanvasRenderingContext2D::accessFont() | 2359 const Font& CanvasRenderingContext2D::accessFont() |
2360 { | 2360 { |
2361 canvas()->document()->updateStyleIfNeeded(); | 2361 canvas()->document()->updateStyleIfNeeded(); |
2362 | 2362 |
2363 if (!state().m_realizedFont) | 2363 if (!state().m_realizedFont) { |
2364 setFont(state().m_unparsedFont); | 2364 // Create temporary string object to hold ref count in case |
| 2365 // state().m_unparsedFont in unreffed by call to realizeSaves in |
| 2366 // setFont. |
| 2367 String unparsedFont(state().m_unparsedFont); |
| 2368 setFont(unparsedFont); |
| 2369 } |
2365 return state().m_font; | 2370 return state().m_font; |
2366 } | 2371 } |
2367 | 2372 |
2368 #if ENABLE(ACCELERATED_2D_CANVAS) && USE(ACCELERATED_COMPOSITING) | 2373 #if ENABLE(ACCELERATED_2D_CANVAS) && USE(ACCELERATED_COMPOSITING) |
2369 PlatformLayer* CanvasRenderingContext2D::platformLayer() const | 2374 PlatformLayer* CanvasRenderingContext2D::platformLayer() const |
2370 { | 2375 { |
2371 return canvas()->buffer() ? canvas()->buffer()->platformLayer() : 0; | 2376 return canvas()->buffer() ? canvas()->buffer()->platformLayer() : 0; |
2372 } | 2377 } |
2373 #endif | 2378 #endif |
2374 | 2379 |
2375 bool CanvasRenderingContext2D::webkitImageSmoothingEnabled() const | 2380 bool CanvasRenderingContext2D::webkitImageSmoothingEnabled() const |
2376 { | 2381 { |
2377 return state().m_imageSmoothingEnabled; | 2382 return state().m_imageSmoothingEnabled; |
2378 } | 2383 } |
2379 | 2384 |
2380 void CanvasRenderingContext2D::setWebkitImageSmoothingEnabled(bool enabled) | 2385 void CanvasRenderingContext2D::setWebkitImageSmoothingEnabled(bool enabled) |
2381 { | 2386 { |
2382 if (enabled == state().m_imageSmoothingEnabled) | 2387 if (enabled == state().m_imageSmoothingEnabled) |
2383 return; | 2388 return; |
2384 | 2389 |
2385 realizeSaves(); | 2390 realizeSaves(); |
2386 modifiableState().m_imageSmoothingEnabled = enabled; | 2391 modifiableState().m_imageSmoothingEnabled = enabled; |
2387 drawingContext()->setImageInterpolationQuality(enabled ? DefaultInterpolatio
nQuality : InterpolationNone); | 2392 drawingContext()->setImageInterpolationQuality(enabled ? DefaultInterpolatio
nQuality : InterpolationNone); |
2388 } | 2393 } |
2389 | 2394 |
2390 } // namespace WebCore | 2395 } // namespace WebCore |
OLD | NEW |