Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp

Issue 1875343002: Move WTF classes related to typed arrays to wtf/typed_arrays (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #include "platform/image-encoders/skia/PNGImageEncoder.h" 47 #include "platform/image-encoders/skia/PNGImageEncoder.h"
48 #include "platform/image-encoders/skia/WEBPImageEncoder.h" 48 #include "platform/image-encoders/skia/WEBPImageEncoder.h"
49 #include "public/platform/Platform.h" 49 #include "public/platform/Platform.h"
50 #include "public/platform/WebExternalTextureMailbox.h" 50 #include "public/platform/WebExternalTextureMailbox.h"
51 #include "public/platform/WebGraphicsContext3D.h" 51 #include "public/platform/WebGraphicsContext3D.h"
52 #include "public/platform/WebGraphicsContext3DProvider.h" 52 #include "public/platform/WebGraphicsContext3DProvider.h"
53 #include "skia/ext/texture_handle.h" 53 #include "skia/ext/texture_handle.h"
54 #include "third_party/skia/include/core/SkPicture.h" 54 #include "third_party/skia/include/core/SkPicture.h"
55 #include "third_party/skia/include/gpu/GrContext.h" 55 #include "third_party/skia/include/gpu/GrContext.h"
56 #include "third_party/skia/include/gpu/gl/GrGLTypes.h" 56 #include "third_party/skia/include/gpu/gl/GrGLTypes.h"
57 #include "wtf/ArrayBufferContents.h"
58 #include "wtf/CheckedNumeric.h" 57 #include "wtf/CheckedNumeric.h"
59 #include "wtf/MathExtras.h" 58 #include "wtf/MathExtras.h"
60 #include "wtf/Vector.h" 59 #include "wtf/Vector.h"
61 #include "wtf/text/Base64.h" 60 #include "wtf/text/Base64.h"
62 #include "wtf/text/WTFString.h" 61 #include "wtf/text/WTFString.h"
62 #include "wtf/typed_arrays/ArrayBufferContents.h"
63 63
64 namespace blink { 64 namespace blink {
65 65
66 PassOwnPtr<ImageBuffer> ImageBuffer::create(PassOwnPtr<ImageBufferSurface> surfa ce) 66 PassOwnPtr<ImageBuffer> ImageBuffer::create(PassOwnPtr<ImageBufferSurface> surfa ce)
67 { 67 {
68 if (!surface->isValid()) 68 if (!surface->isValid())
69 return nullptr; 69 return nullptr;
70 return adoptPtr(new ImageBuffer(std::move(surface))); 70 return adoptPtr(new ImageBuffer(std::move(surface)));
71 } 71 }
72 72
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType)); 403 ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
404 404
405 Vector<unsigned char> result; 405 Vector<unsigned char> result;
406 if (!encodeImage(mimeType, quality, &result)) 406 if (!encodeImage(mimeType, quality, &result))
407 return "data:,"; 407 return "data:,";
408 408
409 return "data:" + mimeType + ";base64," + base64Encode(result); 409 return "data:" + mimeType + ";base64," + base64Encode(result);
410 } 410 }
411 411
412 } // namespace blink 412 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698