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

Unified Diff: src/core/SkMessageBus.h

Issue 902873002: Reimplement gpu message bus for invalidated bitmap gen IDs (Closed) Base URL: https://skia.googlesource.com/skia.git@one_tex
Patch Set: fix speeling error Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/SkGr.h ('k') | src/gpu/GrGpuResource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkMessageBus.h
diff --git a/src/core/SkMessageBus.h b/src/core/SkMessageBus.h
index a005c3b9dfadd1c121397f979c9eec9aacdfb6e1..b25ab8079884e6ea6ffe7cc9ee1915f800c1f090 100644
--- a/src/core/SkMessageBus.h
+++ b/src/core/SkMessageBus.h
@@ -9,6 +9,7 @@
#define SkMessageBus_DEFINED
#include "SkLazyPtr.h"
+#include "SkTArray.h"
#include "SkTDArray.h"
#include "SkThread.h"
#include "SkTypes.h"
@@ -25,10 +26,10 @@ public:
~Inbox();
// Overwrite out with all the messages we've received since the last call. Threadsafe.
- void poll(SkTDArray<Message>* out);
+ void poll(SkTArray<Message>* out);
private:
- SkTDArray<Message> fMessages;
+ SkTArray<Message> fMessages;
SkMutex fMessagesMutex;
friend class SkMessageBus;
@@ -82,15 +83,15 @@ SkMessageBus<Message>::Inbox::~Inbox() {
template<typename Message>
void SkMessageBus<Message>::Inbox::receive(const Message& m) {
SkAutoMutexAcquire lock(fMessagesMutex);
- fMessages.push(m);
+ fMessages.push_back(m);
}
template<typename Message>
-void SkMessageBus<Message>::Inbox::poll(SkTDArray<Message>* messages) {
+void SkMessageBus<Message>::Inbox::poll(SkTArray<Message>* messages) {
SkASSERT(messages);
messages->reset();
SkAutoMutexAcquire lock(fMessagesMutex);
- messages->swap(fMessages);
+ fMessages.swap(messages);
}
// ----------------------- Implementation of SkMessageBus -----------------------
« no previous file with comments | « include/gpu/SkGr.h ('k') | src/gpu/GrGpuResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698