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:
Florin Malita 2017-07-13 15:51:42 -04:00 committed by Skia Commit-Bot
parent b295573c93
commit f264e99683
2 changed files with 0 additions and 19 deletions

View File

@ -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; }

View File

@ -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);