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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 Platform3DObject textureId = m_surface->getBackingTextureHandleForOverwrite(
); | 244 Platform3DObject textureId = m_surface->getBackingTextureHandleForOverwrite(
); |
245 if (!textureId) | 245 if (!textureId) |
246 return false; | 246 return false; |
247 | 247 |
248 context3D->flush(); | 248 context3D->flush(); |
249 | 249 |
250 return drawingBuffer->copyToPlatformTexture(context3D, textureId, GL_RGBA, | 250 return drawingBuffer->copyToPlatformTexture(context3D, textureId, GL_RGBA, |
251 GL_UNSIGNED_BYTE, 0, true, false, sourceBuffer); | 251 GL_UNSIGNED_BYTE, 0, true, false, sourceBuffer); |
252 } | 252 } |
253 | 253 |
254 void ImageBuffer::draw(GraphicsContext* context, const FloatRect& destRect, cons
t FloatRect* srcPtr, SkXfermode::Mode op) | 254 void ImageBuffer::draw(GraphicsContext& context, const FloatRect& destRect, cons
t FloatRect* srcPtr, SkXfermode::Mode op) |
255 { | 255 { |
256 if (!isSurfaceValid()) | 256 if (!isSurfaceValid()) |
257 return; | 257 return; |
258 | 258 |
259 FloatRect srcRect = srcPtr ? *srcPtr : FloatRect(FloatPoint(), FloatSize(siz
e())); | 259 FloatRect srcRect = srcPtr ? *srcPtr : FloatRect(FloatPoint(), FloatSize(siz
e())); |
260 m_surface->draw(context, destRect, srcRect, op); | 260 m_surface->draw(context, destRect, srcRect, op); |
261 } | 261 } |
262 | 262 |
263 void ImageBuffer::flush() | 263 void ImageBuffer::flush() |
264 { | 264 { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); | 371 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); |
372 | 372 |
373 Vector<unsigned char> result; | 373 Vector<unsigned char> result; |
374 if (!encodeImage(mimeType, quality, &result)) | 374 if (!encodeImage(mimeType, quality, &result)) |
375 return "data:,"; | 375 return "data:,"; |
376 | 376 |
377 return "data:" + mimeType + ";base64," + base64Encode(result); | 377 return "data:" + mimeType + ";base64," + base64Encode(result); |
378 } | 378 } |
379 | 379 |
380 } // namespace blink | 380 } // namespace blink |
OLD | NEW |