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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 #include "public/platform/WebExternalTextureMailbox.h" | 52 #include "public/platform/WebExternalTextureMailbox.h" |
53 #include "public/platform/WebGraphicsContext3D.h" | 53 #include "public/platform/WebGraphicsContext3D.h" |
54 #include "public/platform/WebGraphicsContext3DProvider.h" | 54 #include "public/platform/WebGraphicsContext3DProvider.h" |
55 #include "third_party/skia/include/effects/SkTableColorFilter.h" | 55 #include "third_party/skia/include/effects/SkTableColorFilter.h" |
56 #include "wtf/MathExtras.h" | 56 #include "wtf/MathExtras.h" |
57 #include "wtf/text/Base64.h" | 57 #include "wtf/text/Base64.h" |
58 #include "wtf/text/WTFString.h" | 58 #include "wtf/text/WTFString.h" |
59 | 59 |
60 using namespace std; | 60 using namespace std; |
61 | 61 |
62 namespace WebCore { | 62 namespace blink { |
63 | 63 |
64 PassOwnPtr<ImageBuffer> ImageBuffer::create(PassOwnPtr<ImageBufferSurface> surfa
ce) | 64 PassOwnPtr<ImageBuffer> ImageBuffer::create(PassOwnPtr<ImageBufferSurface> surfa
ce) |
65 { | 65 { |
66 if (!surface->isValid()) | 66 if (!surface->isValid()) |
67 return nullptr; | 67 return nullptr; |
68 return adoptPtr(new ImageBuffer(surface)); | 68 return adoptPtr(new ImageBuffer(surface)); |
69 } | 69 } |
70 | 70 |
71 PassOwnPtr<ImageBuffer> ImageBuffer::create(const IntSize& size, OpacityMode opa
cityMode) | 71 PassOwnPtr<ImageBuffer> ImageBuffer::create(const IntSize& size, OpacityMode opa
cityMode) |
72 { | 72 { |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 Vector<char> encodedImage; | 414 Vector<char> encodedImage; |
415 if (!encodeImage(imageData, mimeType, quality, &encodedImage)) | 415 if (!encodeImage(imageData, mimeType, quality, &encodedImage)) |
416 return "data:,"; | 416 return "data:,"; |
417 | 417 |
418 Vector<char> base64Data; | 418 Vector<char> base64Data; |
419 base64Encode(encodedImage, base64Data); | 419 base64Encode(encodedImage, base64Data); |
420 | 420 |
421 return "data:" + mimeType + ";base64," + base64Data; | 421 return "data:" + mimeType + ";base64," + base64Data; |
422 } | 422 } |
423 | 423 |
424 } // namespace WebCore | 424 } // namespace blink |
OLD | NEW |