diff options
author | Mike Reed <reed@google.com> | 2018-01-04 13:52:07 -0500 |
---|---|---|
committer | Mike Reed <reed@google.com> | 2018-01-04 20:33:06 +0000 |
commit | 7edde238f741b7954a18797e88dcd04b59d79d2f (patch) | |
tree | 32a61b6027ef0ca8d7289b9c6dcbf155329a22cb /src/views | |
parent | 02a32b0fa432a720d7b41c263756a7bac53b020b (diff) |
don't include SkMalloc.h from SkTypes.h
Needed chrome CLs
https://chromium-review.googlesource.com/c/chromium/src/+/850741
https://chromium-review.googlesource.com/c/chromium/src/+/850920
Bug: skia:
Change-Id: Ic568174a56590a65bfa284c59fd104275ee78da9
Reviewed-on: https://skia-review.googlesource.com/90823
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'src/views')
-rw-r--r-- | src/views/SkEvent.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/views/SkEvent.cpp b/src/views/SkEvent.cpp index 6ead33ec7f..1bb74fb755 100644 --- a/src/views/SkEvent.cpp +++ b/src/views/SkEvent.cpp @@ -6,6 +6,7 @@ */ #include "SkEvent.h" +#include "SkMalloc.h" void SkEvent::initialize(const char* type) { fType = nullptr; @@ -13,36 +14,30 @@ void SkEvent::initialize(const char* type) { f32 = 0; } -SkEvent::SkEvent() -{ +SkEvent::SkEvent() { initialize(""); } -SkEvent::SkEvent(const SkEvent& src) -{ +SkEvent::SkEvent(const SkEvent& src) { *this = src; setType(src.fType); } -SkEvent::SkEvent(const char type[]) -{ +SkEvent::SkEvent(const char type[]) { SkASSERT(type); initialize(type); } -SkEvent::~SkEvent() -{ +SkEvent::~SkEvent() { sk_free(fType); } -bool SkEvent::isType(const char type[]) const -{ +bool SkEvent::isType(const char type[]) const { size_t typeLen = strlen(type); return strncmp(fType, type, typeLen) == 0 && fType[typeLen] == 0; } -void SkEvent::setType(const char type[]) -{ +void SkEvent::setType(const char type[]) { size_t typeLen = strlen(type); fType = (char*) sk_malloc_throw(typeLen + 1); memcpy(fType, type, typeLen); |