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

Unified Diff: Source/platform/graphics/ImageBuffer.cpp

Issue 134733016: Add support for converting Colors to linear RGB; Fix relevant filters (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: Source/platform/graphics/ImageBuffer.cpp
diff --git a/Source/platform/graphics/ImageBuffer.cpp b/Source/platform/graphics/ImageBuffer.cpp
index d03f512e150fcdf0e779e0ed26d218115b394375..a9693ff5211f9f7cd09402d9130b64b5c98a91fd 100644
--- a/Source/platform/graphics/ImageBuffer.cpp
+++ b/Source/platform/graphics/ImageBuffer.cpp
@@ -220,38 +220,6 @@ void ImageBuffer::drawPattern(GraphicsContext* context, const FloatRect& srcRect
image->drawPattern(context, srcRect, scale, phase, op, destRect, blendMode, repeatSpacing);
}
-static const Vector<uint8_t>& getLinearRgbLUT()
-{
- DEFINE_STATIC_LOCAL(Vector<uint8_t>, linearRgbLUT, ());
- if (linearRgbLUT.isEmpty()) {
- linearRgbLUT.reserveCapacity(256);
- for (unsigned i = 0; i < 256; i++) {
- float color = i / 255.0f;
- color = (color <= 0.04045f ? color / 12.92f : pow((color + 0.055f) / 1.055f, 2.4f));
- color = std::max(0.0f, color);
- color = std::min(1.0f, color);
- linearRgbLUT.append(static_cast<uint8_t>(round(color * 255)));
- }
- }
- return linearRgbLUT;
-}
-
-static const Vector<uint8_t>& getDeviceRgbLUT()
-{
- DEFINE_STATIC_LOCAL(Vector<uint8_t>, deviceRgbLUT, ());
- if (deviceRgbLUT.isEmpty()) {
- deviceRgbLUT.reserveCapacity(256);
- for (unsigned i = 0; i < 256; i++) {
- float color = i / 255.0f;
- color = (powf(color, 1.0f / 2.4f) * 1.055f) - 0.055f;
- color = std::max(0.0f, color);
- color = std::min(1.0f, color);
- deviceRgbLUT.append(static_cast<uint8_t>(round(color * 255)));
- }
- }
- return deviceRgbLUT;
-}
-
void ImageBuffer::transformColorSpace(ColorSpace srcColorSpace, ColorSpace dstColorSpace)
{
if (srcColorSpace == dstColorSpace)

Powered by Google App Engine
This is Rietveld 408576698