aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/views
diff options
context:
space:
mode:
Diffstat (limited to 'src/views')
-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);