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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 { | 131 { |
132 return m_surface->isValid() || m_surface->restore(); | 132 return m_surface->isValid() || m_surface->restore(); |
133 } | 133 } |
134 | 134 |
135 void ImageBuffer::notifySurfaceInvalid() | 135 void ImageBuffer::notifySurfaceInvalid() |
136 { | 136 { |
137 if (m_client) | 137 if (m_client) |
138 m_client->notifySurfaceInvalid(); | 138 m_client->notifySurfaceInvalid(); |
139 } | 139 } |
140 | 140 |
| 141 PassRefPtr<SkImage> ImageBuffer::newImageSnapshot() const |
| 142 { |
| 143 return m_surface->newImageSnapshot(); |
| 144 } |
| 145 |
141 static SkBitmap deepSkBitmapCopy(const SkBitmap& bitmap) | 146 static SkBitmap deepSkBitmapCopy(const SkBitmap& bitmap) |
142 { | 147 { |
143 SkBitmap tmp; | 148 SkBitmap tmp; |
144 if (!bitmap.deepCopyTo(&tmp)) | 149 if (!bitmap.deepCopyTo(&tmp)) |
145 bitmap.copyTo(&tmp, bitmap.colorType()); | 150 bitmap.copyTo(&tmp, bitmap.colorType()); |
146 | 151 |
147 return tmp; | 152 return tmp; |
148 } | 153 } |
149 | 154 |
150 PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior, ScaleBeh
avior) const | 155 PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior, ScaleBeh
avior) const |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); | 440 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); |
436 | 441 |
437 Vector<char> encodedImage; | 442 Vector<char> encodedImage; |
438 if (!encodeImage(imageData, mimeType, quality, &encodedImage)) | 443 if (!encodeImage(imageData, mimeType, quality, &encodedImage)) |
439 return "data:,"; | 444 return "data:,"; |
440 | 445 |
441 return "data:" + mimeType + ";base64," + base64Encode(encodedImage); | 446 return "data:" + mimeType + ";base64," + base64Encode(encodedImage); |
442 } | 447 } |
443 | 448 |
444 } // namespace blink | 449 } // namespace blink |
OLD | NEW |