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

Side by Side Diff: third_party/WebKit/Source/core/layout/shapes/Shape.cpp

Issue 2712083002: color: Remove blink pre-conversion code (Closed)
Patch Set: Rebase Created 3 years, 9 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
OLDNEW
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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 // FIXME: This is not totally correct but it is needed to prevent shapes 239 // FIXME: This is not totally correct but it is needed to prevent shapes
240 // that loads SVG Images during paint invalidations to mark layoutObjects 240 // that loads SVG Images during paint invalidations to mark layoutObjects
241 // for layout, which is not allowed. See https://crbug.com/429346 241 // for layout, which is not allowed. See https://crbug.com/429346
242 ImageObserverDisabler disabler(image); 242 ImageObserverDisabler disabler(image);
243 PaintFlags flags; 243 PaintFlags flags;
244 IntRect imageSourceRect(IntPoint(), image->size()); 244 IntRect imageSourceRect(IntPoint(), image->size());
245 IntRect imageDestRect(IntPoint(), imageRect.size()); 245 IntRect imageDestRect(IntPoint(), imageRect.size());
246 // TODO(ccameron): No color conversion is required here. 246 // TODO(ccameron): No color conversion is required here.
247 image->draw(imageBuffer->canvas(), flags, imageDestRect, imageSourceRect, 247 image->draw(imageBuffer->canvas(), flags, imageDestRect, imageSourceRect,
248 DoNotRespectImageOrientation, 248 DoNotRespectImageOrientation,
249 Image::DoNotClampImageToSourceRect, 249 Image::DoNotClampImageToSourceRect);
250 ColorBehavior::transformToGlobalTarget());
251 250
252 WTF::ArrayBufferContents contents; 251 WTF::ArrayBufferContents contents;
253 imageBuffer->getImageData(Unmultiplied, 252 imageBuffer->getImageData(Unmultiplied,
254 IntRect(IntPoint(), imageRect.size()), contents); 253 IntRect(IntPoint(), imageRect.size()), contents);
255 DOMArrayBuffer* arrayBuffer = DOMArrayBuffer::create(contents); 254 DOMArrayBuffer* arrayBuffer = DOMArrayBuffer::create(contents);
256 DOMUint8ClampedArray* pixelArray = 255 DOMUint8ClampedArray* pixelArray =
257 DOMUint8ClampedArray::create(arrayBuffer, 0, arrayBuffer->byteLength()); 256 DOMUint8ClampedArray::create(arrayBuffer, 0, arrayBuffer->byteLength());
258 unsigned pixelArrayOffset = 3; // Each pixel is four bytes: RGBA. 257 unsigned pixelArrayOffset = 3; // Each pixel is four bytes: RGBA.
259 uint8_t alphaPixelThreshold = threshold * 255; 258 uint8_t alphaPixelThreshold = threshold * 255;
260 259
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 FloatRect rect(0, 0, roundedRect.rect().width(), roundedRect.rect().height()); 297 FloatRect rect(0, 0, roundedRect.rect().width(), roundedRect.rect().height());
299 FloatRoundedRect bounds(rect, roundedRect.getRadii()); 298 FloatRoundedRect bounds(rect, roundedRect.getRadii());
300 std::unique_ptr<Shape> shape = createInsetShape(bounds); 299 std::unique_ptr<Shape> shape = createInsetShape(bounds);
301 shape->m_writingMode = writingMode; 300 shape->m_writingMode = writingMode;
302 shape->m_margin = margin; 301 shape->m_margin = margin;
303 302
304 return shape; 303 return shape;
305 } 304 }
306 305
307 } // namespace blink 306 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698