| 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, 2013 Intel Corporation. All rights reserved. | 8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. |
| 9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
| 10 * | 10 * |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 String CanvasRenderingContext2D::font() const | 409 String CanvasRenderingContext2D::font() const |
| 410 { | 410 { |
| 411 if (!state().hasRealizedFont()) | 411 if (!state().hasRealizedFont()) |
| 412 return defaultFont; | 412 return defaultFont; |
| 413 | 413 |
| 414 canvas()->document().canvasFontCache()->willUseCurrentFont(); | 414 canvas()->document().canvasFontCache()->willUseCurrentFont(); |
| 415 StringBuilder serializedFont; | 415 StringBuilder serializedFont; |
| 416 const FontDescription& fontDescription = state().font().getFontDescription()
; | 416 const FontDescription& fontDescription = state().font().getFontDescription()
; |
| 417 | 417 |
| 418 if (fontDescription.style() == FontStyleItalic) | 418 if (fontDescription.style() == FontStyleItalic) |
| 419 serializedFont.appendLiteral("italic "); | 419 serializedFont.append("italic "); |
| 420 if (fontDescription.weight() == FontWeightBold) | 420 if (fontDescription.weight() == FontWeightBold) |
| 421 serializedFont.appendLiteral("bold "); | 421 serializedFont.append("bold "); |
| 422 if (fontDescription.variantCaps() == FontDescription::SmallCaps) | 422 if (fontDescription.variantCaps() == FontDescription::SmallCaps) |
| 423 serializedFont.appendLiteral("small-caps "); | 423 serializedFont.append("small-caps "); |
| 424 | 424 |
| 425 serializedFont.appendNumber(fontDescription.computedPixelSize()); | 425 serializedFont.appendNumber(fontDescription.computedPixelSize()); |
| 426 serializedFont.appendLiteral("px"); | 426 serializedFont.append("px"); |
| 427 | 427 |
| 428 const FontFamily& firstFontFamily = fontDescription.family(); | 428 const FontFamily& firstFontFamily = fontDescription.family(); |
| 429 for (const FontFamily* fontFamily = &firstFontFamily; fontFamily; fontFamily
= fontFamily->next()) { | 429 for (const FontFamily* fontFamily = &firstFontFamily; fontFamily; fontFamily
= fontFamily->next()) { |
| 430 if (fontFamily != &firstFontFamily) | 430 if (fontFamily != &firstFontFamily) |
| 431 serializedFont.append(','); | 431 serializedFont.append(','); |
| 432 | 432 |
| 433 // FIXME: We should append family directly to serializedFont rather than
building a temporary string. | 433 // FIXME: We should append family directly to serializedFont rather than
building a temporary string. |
| 434 String family = fontFamily->family(); | 434 String family = fontFamily->family(); |
| 435 if (family.startsWith("-webkit-")) | 435 if (family.startsWith("-webkit-")) |
| 436 family = family.substring(8); | 436 family = family.substring(8); |
| (...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1050 | 1050 |
| 1051 unsigned CanvasRenderingContext2D::hitRegionsCount() const | 1051 unsigned CanvasRenderingContext2D::hitRegionsCount() const |
| 1052 { | 1052 { |
| 1053 if (m_hitRegionManager) | 1053 if (m_hitRegionManager) |
| 1054 return m_hitRegionManager->getHitRegionsCount(); | 1054 return m_hitRegionManager->getHitRegionsCount(); |
| 1055 | 1055 |
| 1056 return 0; | 1056 return 0; |
| 1057 } | 1057 } |
| 1058 | 1058 |
| 1059 } // namespace blink | 1059 } // namespace blink |
| OLD | NEW |