Delete unread SkPicture mbox
No longer read?! Change-Id: I6258a64590bb5ee16e02a7ad923ad41cc7bd8791 Reviewed-on: https://skia-review.googlesource.com/23043 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
This commit is contained in:
parent
b295573c93
commit
f264e99683
@ -37,8 +37,6 @@ struct SkPictInfo;
|
||||
*/
|
||||
class SK_API SkPicture : public SkRefCnt {
|
||||
public:
|
||||
virtual ~SkPicture();
|
||||
|
||||
/**
|
||||
* Function signature defining a function that sets up an SkBitmap from encoded data. On
|
||||
* success, the SkBitmap should have its Config, width, height, rowBytes and pixelref set.
|
||||
@ -157,9 +155,6 @@ public:
|
||||
bool suitableForGpuRasterization(GrContext*, const char** whyNot = NULL) const;
|
||||
#endif
|
||||
|
||||
// Sent via SkMessageBus from destructor.
|
||||
struct DeletionMessage { int32_t fUniqueID; }; // TODO: -> uint32_t?
|
||||
|
||||
// Returns NULL if this is not an SkBigPicture.
|
||||
virtual const SkBigPicture* asSkBigPicture() const { return NULL; }
|
||||
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include "SkAtomics.h"
|
||||
#include "SkImageDeserializer.h"
|
||||
#include "SkImageGenerator.h"
|
||||
#include "SkMessageBus.h"
|
||||
#include "SkPicture.h"
|
||||
#include "SkPictureData.h"
|
||||
#include "SkPicturePlayback.h"
|
||||
@ -22,23 +21,10 @@ static bool g_AllPictureIOSecurityPrecautionsEnabled = true;
|
||||
static bool g_AllPictureIOSecurityPrecautionsEnabled = false;
|
||||
#endif
|
||||
|
||||
DECLARE_SKMESSAGEBUS_MESSAGE(SkPicture::DeletionMessage);
|
||||
|
||||
/* SkPicture impl. This handles generic responsibilities like unique IDs and serialization. */
|
||||
|
||||
SkPicture::SkPicture() : fUniqueID(0) {}
|
||||
|
||||
SkPicture::~SkPicture() {
|
||||
// TODO: move this to ~SkBigPicture() only?
|
||||
|
||||
// If the ID is still zero, no one has read it, so no need to send this message.
|
||||
uint32_t id = sk_atomic_load(&fUniqueID, sk_memory_order_relaxed);
|
||||
if (id != 0) {
|
||||
SkPicture::DeletionMessage msg = { (int32_t)id };
|
||||
SkMessageBus<SkPicture::DeletionMessage>::Post(msg);
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t SkPicture::uniqueID() const {
|
||||
static uint32_t gNextID = 1;
|
||||
uint32_t id = sk_atomic_load(&fUniqueID, sk_memory_order_relaxed);
|
||||
|
Loading…
Reference in New Issue
Block a user