Commit 7886ff0c authored by Gyuyoung Kim's avatar Gyuyoung Kim Committed by Commit Bot

BlinkMemoryMgt: Annotate Blink's platform/image-encoders with the macros of Allocator

As a step to annotate the macros of Allocator for the Onion Soup, this CL annotates
some classes of //third_party/blink/renderer/platform/heap with the macros of
Allocator.

After some analyzes, it was concluded that for the case of ImageEncoder class, it makes
sense to use USING_FAST_MALLOC because it has been supported factory functions which
return std::unique_ptr<ImageEncoder>.

In ImageEncoderUtils class, it makes sense to use STATIC_ONLY because it only has static
functions.

Bug: 919389
Change-Id: I892e459c7c21300128f9b6ee320afa8a3633e5a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1502316Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/master@{#637625}
parent fd60d670
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "third_party/blink/renderer/platform/graphics/graphics_types.h" #include "third_party/blink/renderer/platform/graphics/graphics_types.h"
#include "third_party/blink/renderer/platform/platform_export.h" #include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h"
#include "third_party/blink/renderer/platform/wtf/vector.h" #include "third_party/blink/renderer/platform/wtf/vector.h"
#include "third_party/skia/include/core/SkStream.h" #include "third_party/skia/include/core/SkStream.h"
#include "third_party/skia/include/encode/SkJpegEncoder.h" #include "third_party/skia/include/encode/SkJpegEncoder.h"
...@@ -36,6 +37,8 @@ class VectorWStream : public SkWStream { ...@@ -36,6 +37,8 @@ class VectorWStream : public SkWStream {
}; };
class PLATFORM_EXPORT ImageEncoder { class PLATFORM_EXPORT ImageEncoder {
USING_FAST_MALLOC(ImageEncoder);
public: public:
static bool Encode(Vector<unsigned char>* dst, static bool Encode(Vector<unsigned char>* dst,
const SkPixmap& src, const SkPixmap& src,
......
...@@ -7,11 +7,14 @@ ...@@ -7,11 +7,14 @@
#include "third_party/blink/renderer/platform/graphics/graphics_types.h" #include "third_party/blink/renderer/platform/graphics/graphics_types.h"
#include "third_party/blink/renderer/platform/platform_export.h" #include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/blink/renderer/platform/wtf/allocator.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
namespace blink { namespace blink {
class PLATFORM_EXPORT ImageEncoderUtils { class PLATFORM_EXPORT ImageEncoderUtils {
STATIC_ONLY(ImageEncoderUtils);
public: public:
enum EncodeReason { enum EncodeReason {
kEncodeReasonToDataURL = 0, kEncodeReasonToDataURL = 0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment