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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 if (m_client) | 123 if (m_client) |
124 m_client->notifySurfaceInvalid(); | 124 m_client->notifySurfaceInvalid(); |
125 } | 125 } |
126 | 126 |
127 void ImageBuffer::didPresent() | 127 void ImageBuffer::didPresent() |
128 { | 128 { |
129 if (m_client) | 129 if (m_client) |
130 m_client->didPresent(); | 130 m_client->didPresent(); |
131 } | 131 } |
132 | 132 |
| 133 PassRefPtr<SkImage> ImageBuffer::newImageSnapshot() const |
| 134 { |
| 135 return m_surface->newImageSnapshot(); |
| 136 } |
| 137 |
133 static SkBitmap deepSkBitmapCopy(const SkBitmap& bitmap) | 138 static SkBitmap deepSkBitmapCopy(const SkBitmap& bitmap) |
134 { | 139 { |
135 SkBitmap tmp; | 140 SkBitmap tmp; |
136 if (!bitmap.deepCopyTo(&tmp)) | 141 if (!bitmap.deepCopyTo(&tmp)) |
137 bitmap.copyTo(&tmp, bitmap.colorType()); | 142 bitmap.copyTo(&tmp, bitmap.colorType()); |
138 | 143 |
139 return tmp; | 144 return tmp; |
140 } | 145 } |
141 | 146 |
142 PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior, ScaleBeh
avior) const | 147 PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior, ScaleBeh
avior) const |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 if (!encodeImage(imageData, mimeType, quality, &encodedImage)) | 427 if (!encodeImage(imageData, mimeType, quality, &encodedImage)) |
423 return "data:,"; | 428 return "data:,"; |
424 | 429 |
425 Vector<char> base64Data; | 430 Vector<char> base64Data; |
426 base64Encode(encodedImage, base64Data); | 431 base64Encode(encodedImage, base64Data); |
427 | 432 |
428 return "data:" + mimeType + ";base64," + base64Data; | 433 return "data:" + mimeType + ";base64," + base64Data; |
429 } | 434 } |
430 | 435 |
431 } // namespace blink | 436 } // namespace blink |
OLD | NEW |