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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 // that loads SVG Images during paint invalidations to mark layoutObject
s for | 201 // that loads SVG Images during paint invalidations to mark layoutObject
s for |
202 // layout, which is not allowed. See https://crbug.com/429346 | 202 // layout, which is not allowed. See https://crbug.com/429346 |
203 ImageObserverDisabler disabler(image); | 203 ImageObserverDisabler disabler(image); |
204 SkPaint paint; | 204 SkPaint paint; |
205 IntRect imageSourceRect(IntPoint(), image->size()); | 205 IntRect imageSourceRect(IntPoint(), image->size()); |
206 IntRect imageDestRect(IntPoint(), imageRect.size()); | 206 IntRect imageDestRect(IntPoint(), imageRect.size()); |
207 image->draw(imageBuffer->canvas(), paint, imageDestRect, imageSourceRect
, DoNotRespectImageOrientation, Image::DoNotClampImageToSourceRect); | 207 image->draw(imageBuffer->canvas(), paint, imageDestRect, imageSourceRect
, DoNotRespectImageOrientation, Image::DoNotClampImageToSourceRect); |
208 | 208 |
209 WTF::ArrayBufferContents contents; | 209 WTF::ArrayBufferContents contents; |
210 imageBuffer->getImageData(Unmultiplied, IntRect(IntPoint(), imageRect.si
ze()), contents); | 210 imageBuffer->getImageData(Unmultiplied, IntRect(IntPoint(), imageRect.si
ze()), contents); |
211 RefPtr<DOMArrayBuffer> arrayBuffer = DOMArrayBuffer::create(contents); | 211 DOMArrayBuffer* arrayBuffer = DOMArrayBuffer::create(contents); |
212 RefPtr<DOMUint8ClampedArray> pixelArray = DOMUint8ClampedArray::create(a
rrayBuffer, 0, arrayBuffer->byteLength()); | 212 DOMUint8ClampedArray* pixelArray = DOMUint8ClampedArray::create(arrayBuf
fer, 0, arrayBuffer->byteLength()); |
213 unsigned pixelArrayOffset = 3; // Each pixel is four bytes: RGBA. | 213 unsigned pixelArrayOffset = 3; // Each pixel is four bytes: RGBA. |
214 uint8_t alphaPixelThreshold = threshold * 255; | 214 uint8_t alphaPixelThreshold = threshold * 255; |
215 | 215 |
216 ASSERT(static_cast<unsigned>(imageRect.width() * imageRect.height() * 4)
== pixelArray->length()); | 216 ASSERT(static_cast<unsigned>(imageRect.width() * imageRect.height() * 4)
== pixelArray->length()); |
217 | 217 |
218 int minBufferY = std::max(0, marginRect.y() - imageRect.y()); | 218 int minBufferY = std::max(0, marginRect.y() - imageRect.y()); |
219 int maxBufferY = std::min(imageRect.height(), marginRect.maxY() - imageR
ect.y()); | 219 int maxBufferY = std::min(imageRect.height(), marginRect.maxY() - imageR
ect.y()); |
220 | 220 |
221 for (int y = minBufferY; y < maxBufferY; ++y) { | 221 for (int y = minBufferY; y < maxBufferY; ++y) { |
222 int startX = -1; | 222 int startX = -1; |
(...skipping 22 matching lines...) Expand all Loading... |
245 FloatRect rect(0, 0, roundedRect.rect().width(), roundedRect.rect().height()
); | 245 FloatRect rect(0, 0, roundedRect.rect().width(), roundedRect.rect().height()
); |
246 FloatRoundedRect bounds(rect, roundedRect.getRadii()); | 246 FloatRoundedRect bounds(rect, roundedRect.getRadii()); |
247 OwnPtr<Shape> shape = createInsetShape(bounds); | 247 OwnPtr<Shape> shape = createInsetShape(bounds); |
248 shape->m_writingMode = writingMode; | 248 shape->m_writingMode = writingMode; |
249 shape->m_margin = margin; | 249 shape->m_margin = margin; |
250 | 250 |
251 return shape.release(); | 251 return shape.release(); |
252 } | 252 } |
253 | 253 |
254 } // namespace blink | 254 } // namespace blink |
OLD | NEW |