| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |