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 24 matching lines...) Expand all Loading... |
35 #include "gpu/command_buffer/client/gles2_interface.h" | 35 #include "gpu/command_buffer/client/gles2_interface.h" |
36 #include "platform/MIMETypeRegistry.h" | 36 #include "platform/MIMETypeRegistry.h" |
37 #include "platform/geometry/IntRect.h" | 37 #include "platform/geometry/IntRect.h" |
38 #include "platform/graphics/GraphicsContext.h" | 38 #include "platform/graphics/GraphicsContext.h" |
39 #include "platform/graphics/ImageBufferClient.h" | 39 #include "platform/graphics/ImageBufferClient.h" |
40 #include "platform/graphics/StaticBitmapImage.h" | 40 #include "platform/graphics/StaticBitmapImage.h" |
41 #include "platform/graphics/UnacceleratedImageBufferSurface.h" | 41 #include "platform/graphics/UnacceleratedImageBufferSurface.h" |
42 #include "platform/graphics/gpu/DrawingBuffer.h" | 42 #include "platform/graphics/gpu/DrawingBuffer.h" |
43 #include "platform/graphics/gpu/Extensions3DUtil.h" | 43 #include "platform/graphics/gpu/Extensions3DUtil.h" |
44 #include "platform/graphics/skia/SkiaUtils.h" | 44 #include "platform/graphics/skia/SkiaUtils.h" |
45 #include "platform/image-encoders/skia/JPEGImageEncoder.h" | 45 #include "platform/image-encoders/JPEGImageEncoder.h" |
46 #include "platform/image-encoders/skia/PNGImageEncoder.h" | 46 #include "platform/image-encoders/PNGImageEncoder.h" |
47 #include "platform/image-encoders/skia/WEBPImageEncoder.h" | 47 #include "platform/image-encoders/WEBPImageEncoder.h" |
48 #include "public/platform/Platform.h" | 48 #include "public/platform/Platform.h" |
49 #include "public/platform/WebExternalTextureMailbox.h" | 49 #include "public/platform/WebExternalTextureMailbox.h" |
50 #include "public/platform/WebGraphicsContext3DProvider.h" | 50 #include "public/platform/WebGraphicsContext3DProvider.h" |
51 #include "skia/ext/texture_handle.h" | 51 #include "skia/ext/texture_handle.h" |
52 #include "third_party/skia/include/core/SkPicture.h" | 52 #include "third_party/skia/include/core/SkPicture.h" |
53 #include "third_party/skia/include/gpu/GrContext.h" | 53 #include "third_party/skia/include/gpu/GrContext.h" |
54 #include "third_party/skia/include/gpu/gl/GrGLTypes.h" | 54 #include "third_party/skia/include/gpu/gl/GrGLTypes.h" |
55 #include "wtf/CheckedNumeric.h" | 55 #include "wtf/CheckedNumeric.h" |
56 #include "wtf/MathExtras.h" | 56 #include "wtf/MathExtras.h" |
57 #include "wtf/Vector.h" | 57 #include "wtf/Vector.h" |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); | 400 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); |
401 | 401 |
402 Vector<unsigned char> result; | 402 Vector<unsigned char> result; |
403 if (!encodeImage(mimeType, quality, &result)) | 403 if (!encodeImage(mimeType, quality, &result)) |
404 return "data:,"; | 404 return "data:,"; |
405 | 405 |
406 return "data:" + mimeType + ";base64," + base64Encode(result); | 406 return "data:" + mimeType + ";base64," + base64Encode(result); |
407 } | 407 } |
408 | 408 |
409 } // namespace blink | 409 } // namespace blink |
OLD | NEW |