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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 return m_context.get(); | 145 return m_context.get(); |
146 } | 146 } |
147 | 147 |
148 size_t ImageBuffer::dataSize() const | 148 size_t ImageBuffer::dataSize() const |
149 { | 149 { |
150 return m_size.width() * m_size.height() * 4; | 150 return m_size.width() * m_size.height() * 4; |
151 } | 151 } |
152 | 152 |
153 PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior) const | 153 PassRefPtr<Image> ImageBuffer::copyImage(BackingStoreCopy copyBehavior) const |
154 { | 154 { |
155 return BitmapImageSingleFrameSkia::create(*m_data.m_platformContext.bitmap()
, copyBehavior == CopyBackingStore); | 155 ASSERT(copyBehavior == CopyBackingStore); |
| 156 return BitmapImageSingleFrameSkia::create(*m_data.m_platformContext.bitmap()
, true); |
156 } | 157 } |
157 | 158 |
158 PlatformLayer* ImageBuffer::platformLayer() const | 159 PlatformLayer* ImageBuffer::platformLayer() const |
159 { | 160 { |
160 return m_data.m_platformLayer.get(); | 161 return m_data.m_platformLayer.get(); |
161 } | 162 } |
162 | 163 |
163 void ImageBuffer::clip(GraphicsContext* context, const FloatRect& rect) const | 164 void ImageBuffer::clip(GraphicsContext* context, const FloatRect& rect) const |
164 { | 165 { |
165 context->platformContext()->beginLayerClippedToImage(rect, this); | 166 context->platformContext()->beginLayerClippedToImage(rect, this); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 | 353 |
353 Vector<char> encodedImage, base64Data; | 354 Vector<char> encodedImage, base64Data; |
354 if (!encodeImage(imageData, mimeType, quality, &encodedImage)) | 355 if (!encodeImage(imageData, mimeType, quality, &encodedImage)) |
355 return "data:,"; | 356 return "data:,"; |
356 | 357 |
357 base64Encode(encodedImage, base64Data); | 358 base64Encode(encodedImage, base64Data); |
358 return "data:" + mimeType + ";base64," + base64Data; | 359 return "data:" + mimeType + ";base64," + base64Data; |
359 } | 360 } |
360 | 361 |
361 } // namespace WebCore | 362 } // namespace WebCore |
OLD | NEW |