| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 { | 86 { |
| 87 } | 87 } |
| 88 | 88 |
| 89 SkCanvas* ImageBuffer::canvas() const | 89 SkCanvas* ImageBuffer::canvas() const |
| 90 { | 90 { |
| 91 if (!isSurfaceValid()) | 91 if (!isSurfaceValid()) |
| 92 return nullptr; | 92 return nullptr; |
| 93 return m_surface->canvas(); | 93 return m_surface->canvas(); |
| 94 } | 94 } |
| 95 | 95 |
| 96 SkCanvas* ImageBuffer::immediateCanvas() const | 96 void ImageBuffer::disableDeferral() const |
| 97 { | 97 { |
| 98 if (!isSurfaceValid()) | 98 return m_surface->disableDeferral(); |
| 99 return nullptr; | |
| 100 return m_surface->immediateCanvas(); | |
| 101 } | 99 } |
| 102 | 100 |
| 103 bool ImageBuffer::writePixels(const SkImageInfo& info, const void* pixels, size_
t rowBytes, int x, int y) | 101 bool ImageBuffer::writePixels(const SkImageInfo& info, const void* pixels, size_
t rowBytes, int x, int y) |
| 104 { | 102 { |
| 105 return m_surface->writePixels(info, pixels, rowBytes, x, y); | 103 return m_surface->writePixels(info, pixels, rowBytes, x, y); |
| 106 } | 104 } |
| 107 | 105 |
| 108 const SkBitmap& ImageBuffer::deprecatedBitmapForOverwrite() const | 106 const SkBitmap& ImageBuffer::deprecatedBitmapForOverwrite() const |
| 109 { | 107 { |
| 110 return m_surface->deprecatedBitmapForOverwrite(); | 108 return m_surface->deprecatedBitmapForOverwrite(); |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); | 362 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); |
| 365 | 363 |
| 366 Vector<char> encodedImage; | 364 Vector<char> encodedImage; |
| 367 if (!encodeImage(*this, mimeType, quality, &encodedImage)) | 365 if (!encodeImage(*this, mimeType, quality, &encodedImage)) |
| 368 return "data:,"; | 366 return "data:,"; |
| 369 | 367 |
| 370 return "data:" + mimeType + ";base64," + base64Encode(encodedImage); | 368 return "data:" + mimeType + ";base64," + base64Encode(encodedImage); |
| 371 } | 369 } |
| 372 | 370 |
| 373 } // namespace blink | 371 } // namespace blink |
| OLD | NEW |