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

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

Issue 11808004: Merge 138994 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 years, 11 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 | « LayoutTests/fast/canvas/canvas-measureText-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) 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 2355 matching lines...) Expand 10 before | Expand all | Expand 10 after
2366 else if (state().m_lineCap == SquareCap) 2366 else if (state().m_lineCap == SquareCap)
2367 delta *= root2; 2367 delta *= root2;
2368 2368
2369 rect.inflate(delta); 2369 rect.inflate(delta);
2370 } 2370 }
2371 2371
2372 const Font& CanvasRenderingContext2D::accessFont() 2372 const Font& CanvasRenderingContext2D::accessFont()
2373 { 2373 {
2374 canvas()->document()->updateStyleIfNeeded(); 2374 canvas()->document()->updateStyleIfNeeded();
2375 2375
2376 if (!state().m_realizedFont) 2376 if (!state().m_realizedFont) {
2377 setFont(state().m_unparsedFont); 2377 // Create temporary string object to hold ref count in case
2378 // state().m_unparsedFont in unreffed by call to realizeSaves in
2379 // setFont.
2380 String unparsedFont(state().m_unparsedFont);
2381 setFont(unparsedFont);
2382 }
2378 return state().m_font; 2383 return state().m_font;
2379 } 2384 }
2380 2385
2381 #if ENABLE(ACCELERATED_2D_CANVAS) && USE(ACCELERATED_COMPOSITING) 2386 #if ENABLE(ACCELERATED_2D_CANVAS) && USE(ACCELERATED_COMPOSITING)
2382 PlatformLayer* CanvasRenderingContext2D::platformLayer() const 2387 PlatformLayer* CanvasRenderingContext2D::platformLayer() const
2383 { 2388 {
2384 return canvas()->buffer() ? canvas()->buffer()->platformLayer() : 0; 2389 return canvas()->buffer() ? canvas()->buffer()->platformLayer() : 0;
2385 } 2390 }
2386 #endif 2391 #endif
2387 2392
2388 bool CanvasRenderingContext2D::webkitImageSmoothingEnabled() const 2393 bool CanvasRenderingContext2D::webkitImageSmoothingEnabled() const
2389 { 2394 {
2390 return state().m_imageSmoothingEnabled; 2395 return state().m_imageSmoothingEnabled;
2391 } 2396 }
2392 2397
2393 void CanvasRenderingContext2D::setWebkitImageSmoothingEnabled(bool enabled) 2398 void CanvasRenderingContext2D::setWebkitImageSmoothingEnabled(bool enabled)
2394 { 2399 {
2395 if (enabled == state().m_imageSmoothingEnabled) 2400 if (enabled == state().m_imageSmoothingEnabled)
2396 return; 2401 return;
2397 2402
2398 realizeSaves(); 2403 realizeSaves();
2399 modifiableState().m_imageSmoothingEnabled = enabled; 2404 modifiableState().m_imageSmoothingEnabled = enabled;
2400 drawingContext()->setImageInterpolationQuality(enabled ? DefaultInterpolatio nQuality : InterpolationNone); 2405 drawingContext()->setImageInterpolationQuality(enabled ? DefaultInterpolatio nQuality : InterpolationNone);
2401 } 2406 }
2402 2407
2403 } // namespace WebCore 2408 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/canvas/canvas-measureText-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698