OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
10 * disclaimer. | 10 * disclaimer. |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::create(imageRect.siz
e()); | 198 std::unique_ptr<ImageBuffer> imageBuffer = ImageBuffer::create(imageRect.siz
e()); |
199 | 199 |
200 if (image && imageBuffer) { | 200 if (image && imageBuffer) { |
201 // FIXME: This is not totally correct but it is needed to prevent shapes | 201 // FIXME: This is not totally correct but it is needed to prevent shapes |
202 // that loads SVG Images during paint invalidations to mark layoutObject
s for | 202 // that loads SVG Images during paint invalidations to mark layoutObject
s for |
203 // layout, which is not allowed. See https://crbug.com/429346 | 203 // layout, which is not allowed. See https://crbug.com/429346 |
204 ImageObserverDisabler disabler(image); | 204 ImageObserverDisabler disabler(image); |
205 SkPaint paint; | 205 SkPaint paint; |
206 IntRect imageSourceRect(IntPoint(), image->size()); | 206 IntRect imageSourceRect(IntPoint(), image->size()); |
207 IntRect imageDestRect(IntPoint(), imageRect.size()); | 207 IntRect imageDestRect(IntPoint(), imageRect.size()); |
208 image->draw(imageBuffer->canvas(), paint, imageDestRect, imageSourceRect
, DoNotRespectImageOrientation, Image::DoNotClampImageToSourceRect); | 208 image->draw(imageBuffer->canvas(), paint, imageDestRect, imageSourceRect
, true, DoNotRespectImageOrientation, Image::DoNotClampImageToSourceRect); |
209 | 209 |
210 WTF::ArrayBufferContents contents; | 210 WTF::ArrayBufferContents contents; |
211 imageBuffer->getImageData(Unmultiplied, IntRect(IntPoint(), imageRect.si
ze()), contents); | 211 imageBuffer->getImageData(Unmultiplied, IntRect(IntPoint(), imageRect.si
ze()), contents); |
212 DOMArrayBuffer* arrayBuffer = DOMArrayBuffer::create(contents); | 212 DOMArrayBuffer* arrayBuffer = DOMArrayBuffer::create(contents); |
213 DOMUint8ClampedArray* pixelArray = DOMUint8ClampedArray::create(arrayBuf
fer, 0, arrayBuffer->byteLength()); | 213 DOMUint8ClampedArray* pixelArray = DOMUint8ClampedArray::create(arrayBuf
fer, 0, arrayBuffer->byteLength()); |
214 unsigned pixelArrayOffset = 3; // Each pixel is four bytes: RGBA. | 214 unsigned pixelArrayOffset = 3; // Each pixel is four bytes: RGBA. |
215 uint8_t alphaPixelThreshold = threshold * 255; | 215 uint8_t alphaPixelThreshold = threshold * 255; |
216 | 216 |
217 ASSERT(static_cast<unsigned>(imageRect.width() * imageRect.height() * 4)
== pixelArray->length()); | 217 ASSERT(static_cast<unsigned>(imageRect.width() * imageRect.height() * 4)
== pixelArray->length()); |
218 | 218 |
(...skipping 27 matching lines...) Expand all Loading... |
246 FloatRect rect(0, 0, roundedRect.rect().width(), roundedRect.rect().height()
); | 246 FloatRect rect(0, 0, roundedRect.rect().width(), roundedRect.rect().height()
); |
247 FloatRoundedRect bounds(rect, roundedRect.getRadii()); | 247 FloatRoundedRect bounds(rect, roundedRect.getRadii()); |
248 std::unique_ptr<Shape> shape = createInsetShape(bounds); | 248 std::unique_ptr<Shape> shape = createInsetShape(bounds); |
249 shape->m_writingMode = writingMode; | 249 shape->m_writingMode = writingMode; |
250 shape->m_margin = margin; | 250 shape->m_margin = margin; |
251 | 251 |
252 return shape; | 252 return shape; |
253 } | 253 } |
254 | 254 |
255 } // namespace blink | 255 } // namespace blink |
OLD | NEW |