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 2200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2211 | 2211 |
2212 if (hitRegionPath.isEmpty() || !c || !state().isTransformInvertible() | 2212 if (hitRegionPath.isEmpty() || !c || !state().isTransformInvertible() |
2213 || !c->getClipDeviceBounds(0)) { | 2213 || !c->getClipDeviceBounds(0)) { |
2214 exceptionState.throwDOMException(NotSupportedError, "The specified path
has no pixels."); | 2214 exceptionState.throwDOMException(NotSupportedError, "The specified path
has no pixels."); |
2215 return; | 2215 return; |
2216 } | 2216 } |
2217 | 2217 |
2218 hitRegionPath.transform(state().transform()); | 2218 hitRegionPath.transform(state().transform()); |
2219 | 2219 |
2220 if (state().hasClip()) { | 2220 if (state().hasClip()) { |
2221 // FIXME: The hit regions should take clipping region into account. | 2221 hitRegionPath = state().intersectPathWithClip(hitRegionPath.skPath()); |
2222 // However, we have no way to get the region from canvas state stack by
now. | 2222 if (hitRegionPath.isEmpty()) |
2223 // See http://crbug.com/387057 | 2223 exceptionState.throwDOMException(NotSupportedError, "The specified p
ath has no pixels."); |
2224 exceptionState.throwDOMException(NotSupportedError, "The specified path
has no pixels."); | |
2225 return; | |
2226 } | 2224 } |
2227 | 2225 |
2228 if (!m_hitRegionManager) | 2226 if (!m_hitRegionManager) |
2229 m_hitRegionManager = HitRegionManager::create(); | 2227 m_hitRegionManager = HitRegionManager::create(); |
2230 | 2228 |
2231 // Remove previous region (with id or control) | 2229 // Remove previous region (with id or control) |
2232 m_hitRegionManager->removeHitRegionById(options.id()); | 2230 m_hitRegionManager->removeHitRegionById(options.id()); |
2233 m_hitRegionManager->removeHitRegionByControl(options.control().get()); | 2231 m_hitRegionManager->removeHitRegionByControl(options.control().get()); |
2234 | 2232 |
2235 RefPtrWillBeRawPtr<HitRegion> hitRegion = HitRegion::create(hitRegionPath, o
ptions); | 2233 RefPtrWillBeRawPtr<HitRegion> hitRegion = HitRegion::create(hitRegionPath, o
ptions); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2328 if (imageType == CanvasRenderingContext2DState::NonOpaqueImage) | 2326 if (imageType == CanvasRenderingContext2DState::NonOpaqueImage) |
2329 return; | 2327 return; |
2330 if (alpha < 0xFF) | 2328 if (alpha < 0xFF) |
2331 return; | 2329 return; |
2332 } | 2330 } |
2333 | 2331 |
2334 canvas()->buffer()->willOverwriteCanvas(); | 2332 canvas()->buffer()->willOverwriteCanvas(); |
2335 } | 2333 } |
2336 | 2334 |
2337 } // namespace blink | 2335 } // namespace blink |
OLD | NEW |