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