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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 { | 116 { |
117 return m_surface->isValid() || m_surface->restore(); | 117 return m_surface->isValid() || m_surface->restore(); |
118 } | 118 } |
119 | 119 |
120 void ImageBuffer::notifySurfaceInvalid() | 120 void ImageBuffer::notifySurfaceInvalid() |
121 { | 121 { |
122 if (m_client) | 122 if (m_client) |
123 m_client->notifySurfaceInvalid(); | 123 m_client->notifySurfaceInvalid(); |
124 } | 124 } |
125 | 125 |
126 void ImageBuffer::didPresent() | |
Stephen White
2014/07/17 15:28:19
It seems unfortunate that ImageBuffer has all this
| |
127 { | |
128 if (m_client) | |
129 m_client->didPresent(); | |
130 } | |
131 | |
126 static SkBitmap deepSkBitmapCopy(const SkBitmap& bitmap) | 132 static SkBitmap deepSkBitmapCopy(const SkBitmap& bitmap) |
127 { | 133 { |
128 SkBitmap tmp; | 134 SkBitmap tmp; |
129 if (!bitmap.deepCopyTo(&tmp)) | 135 if (!bitmap.deepCopyTo(&tmp)) |
130 bitmap.copyTo(&tmp, bitmap.colorType()); | 136 bitmap.copyTo(&tmp, bitmap.colorType()); |
131 | 137 |
132 return tmp; | 138 return tmp; |
133 } | 139 } |
134 | 140 |
135 PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior, ScaleBeh avior) const | 141 PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior, ScaleBeh avior) const |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
409 if (!encodeImage(imageData, mimeType, quality, &encodedImage)) | 415 if (!encodeImage(imageData, mimeType, quality, &encodedImage)) |
410 return "data:,"; | 416 return "data:,"; |
411 | 417 |
412 Vector<char> base64Data; | 418 Vector<char> base64Data; |
413 base64Encode(encodedImage, base64Data); | 419 base64Encode(encodedImage, base64Data); |
414 | 420 |
415 return "data:" + mimeType + ";base64," + base64Data; | 421 return "data:" + mimeType + ";base64," + base64Data; |
416 } | 422 } |
417 | 423 |
418 } // namespace WebCore | 424 } // namespace WebCore |
OLD | NEW |