aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/views/SkEvent.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2018-01-04 13:52:07 -0500
committerGravatar Mike Reed <reed@google.com>2018-01-04 20:33:06 +0000
commit7edde238f741b7954a18797e88dcd04b59d79d2f (patch)
tree32a61b6027ef0ca8d7289b9c6dcbf155329a22cb /src/views/SkEvent.cpp
parent02a32b0fa432a720d7b41c263756a7bac53b020b (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/SkEvent.cpp')
-rw-r--r--src/views/SkEvent.cpp19
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);