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

Side by Side Diff: Source/core/platform/graphics/skia/ImageBufferSkia.cpp

Issue 14856010: Adding color space conversion code (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Attemptimp to re-upload the patch Created 7 years, 6 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) 2008, Google Inc. All rights reserved. 2 * Copyright (c) 2008, Google Inc. All rights reserved.
3 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 3 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are 7 * modification, are permitted provided that the following conditions are
8 * met: 8 * met:
9 * 9 *
10 * * Redistributions of source code must retain the above copyright 10 * * Redistributions of source code must retain the above copyright
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 } 267 }
268 268
269 void ImageBuffer::drawPattern(GraphicsContext* context, const FloatRect& srcRect , const AffineTransform& patternTransform, 269 void ImageBuffer::drawPattern(GraphicsContext* context, const FloatRect& srcRect , const AffineTransform& patternTransform,
270 const FloatPoint& phase, CompositeOperator op, const FloatRect& destRect) 270 const FloatPoint& phase, CompositeOperator op, const FloatRect& destRect)
271 { 271 {
272 const SkBitmap& bitmap = *m_context->bitmap(); 272 const SkBitmap& bitmap = *m_context->bitmap();
273 RefPtr<Image> image = BitmapImage::create(NativeImageSkia::create(drawNeedsC opy(m_context.get(), context) ? deepSkBitmapCopy(bitmap) : bitmap)); 273 RefPtr<Image> image = BitmapImage::create(NativeImageSkia::create(drawNeedsC opy(m_context.get(), context) ? deepSkBitmapCopy(bitmap) : bitmap));
274 image->drawPattern(context, srcRect, patternTransform, phase, op, destRect); 274 image->drawPattern(context, srcRect, patternTransform, phase, op, destRect);
275 } 275 }
276 276
277 void ImageBuffer::platformTransformColorSpace(const Vector<int>& lookUpTable) 277 void ImageBuffer::platformTransformColorSpace(const Vector<uint8_t>& lookUpTable )
278 { 278 {
279 // FIXME: Disable color space conversions on accelerated canvases (for now). 279 // FIXME: Disable color space conversions on accelerated canvases (for now).
280 if (context()->isAccelerated()) 280 if (context()->isAccelerated())
281 return; 281 return;
282 282
283 const SkBitmap& bitmap = *context()->bitmap(); 283 const SkBitmap& bitmap = *context()->bitmap();
284 if (bitmap.isNull()) 284 if (bitmap.isNull())
285 return; 285 return;
286 286
287 ASSERT(bitmap.config() == SkBitmap::kARGB_8888_Config); 287 ASSERT(bitmap.config() == SkBitmap::kARGB_8888_Config);
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 if (!encodeImage(imageData, mimeType, quality, &encodedImage)) 437 if (!encodeImage(imageData, mimeType, quality, &encodedImage))
438 return "data:,"; 438 return "data:,";
439 439
440 Vector<char> base64Data; 440 Vector<char> base64Data;
441 base64Encode(encodedImage, base64Data); 441 base64Encode(encodedImage, base64Data);
442 442
443 return "data:" + mimeType + ";base64," + base64Data; 443 return "data:" + mimeType + ";base64," + base64Data;
444 } 444 }
445 445
446 } // namespace WebCore 446 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/platform/graphics/filters/SkiaImageFilterBuilder.cpp ('k') | Source/core/rendering/FilterEffectRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698