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

Side by Side Diff: src/views/SkEventSink.cpp

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 years, 3 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
« no previous file with comments | « src/utils/win/SkWGL_win.cpp ('k') | src/xml/SkDOM.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkEventSink.h" 10 #include "SkEventSink.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 SkListenersTagList* prev = (SkListenersTagList*)this->findTagList(kListeners _SkTagList); 141 SkListenersTagList* prev = (SkListenersTagList*)this->findTagList(kListeners _SkTagList);
142 int count = 0; 142 int count = 0;
143 143
144 if (prev) 144 if (prev)
145 { 145 {
146 if (prev->find(id) >= 0) 146 if (prev->find(id) >= 0)
147 return; 147 return;
148 count = prev->countListners(); 148 count = prev->countListners();
149 } 149 }
150 150
151 SkListenersTagList* next = SkNEW_ARGS(SkListenersTagList, (count + 1)); 151 SkListenersTagList* next = new SkListenersTagList(count + 1);
152 152
153 if (prev) 153 if (prev)
154 { 154 {
155 memcpy(next->fIDs, prev->fIDs, count * sizeof(SkEventSinkID)); 155 memcpy(next->fIDs, prev->fIDs, count * sizeof(SkEventSinkID));
156 this->removeTagList(kListeners_SkTagList); 156 this->removeTagList(kListeners_SkTagList);
157 } 157 }
158 next->fIDs[count] = id; 158 next->fIDs[count] = id;
159 this->addTagList(next); 159 this->addTagList(next);
160 } 160 }
161 161
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 return this->findTagList(kListeners_SkTagList) != NULL; 202 return this->findTagList(kListeners_SkTagList) != NULL;
203 } 203 }
204 204
205 void SkEventSink::postToListeners(const SkEvent& evt, SkMSec delay) { 205 void SkEventSink::postToListeners(const SkEvent& evt, SkMSec delay) {
206 SkListenersTagList* list = (SkListenersTagList*)this->findTagList(kListeners _SkTagList); 206 SkListenersTagList* list = (SkListenersTagList*)this->findTagList(kListeners _SkTagList);
207 if (list) { 207 if (list) {
208 SkASSERT(list->countListners() > 0); 208 SkASSERT(list->countListners() > 0);
209 const SkEventSinkID* iter = list->fIDs; 209 const SkEventSinkID* iter = list->fIDs;
210 const SkEventSinkID* stop = iter + list->countListners(); 210 const SkEventSinkID* stop = iter + list->countListners();
211 while (iter < stop) { 211 while (iter < stop) {
212 SkEvent* copy = SkNEW_ARGS(SkEvent, (evt)); 212 SkEvent* copy = new SkEvent(evt);
213 copy->setTargetID(*iter++)->postDelay(delay); 213 copy->setTargetID(*iter++)->postDelay(delay);
214 } 214 }
215 } 215 }
216 } 216 }
217 217
218 /////////////////////////////////////////////////////////////////////////////// 218 ///////////////////////////////////////////////////////////////////////////////
219 219
220 SkEventSink::EventResult SkEventSink::DoEvent(const SkEvent& evt) { 220 SkEventSink::EventResult SkEventSink::DoEvent(const SkEvent& evt) {
221 SkEvent::Proc proc = evt.getTargetProc(); 221 SkEvent::Proc proc = evt.getTargetProc();
222 if (proc) { 222 if (proc) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 /** Remove all name/id pairs from the system. This is call internally 292 /** Remove all name/id pairs from the system. This is call internally
293 on shutdown, to ensure no memory leaks. It should not be called 293 on shutdown, to ensure no memory leaks. It should not be called
294 before shutdown. 294 before shutdown.
295 */ 295 */
296 void SkEventSink::RemoveAllNamedSinkIDs() 296 void SkEventSink::RemoveAllNamedSinkIDs()
297 { 297 {
298 SkAutoMutexAcquire ac(gNamedSinkMutex); 298 SkAutoMutexAcquire ac(gNamedSinkMutex);
299 (void)gNamedSinkIDs.reset(); 299 (void)gNamedSinkIDs.reset();
300 } 300 }
301 #endif 301 #endif
OLDNEW
« no previous file with comments | « src/utils/win/SkWGL_win.cpp ('k') | src/xml/SkDOM.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698