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

Unified Diff: src/image/SkDataPixelRef.cpp

Issue 106883006: Add a release procedure to SkMallocPixelRef; remove SkDataPixelRef (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 6 years, 12 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 | « src/image/SkDataPixelRef.h ('k') | src/image/SkImage_Raster.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkDataPixelRef.cpp
diff --git a/src/image/SkDataPixelRef.cpp b/src/image/SkDataPixelRef.cpp
deleted file mode 100644
index c8bfe8083d1d513d85580e6732fc8ea6e33e2cde..0000000000000000000000000000000000000000
--- a/src/image/SkDataPixelRef.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2012 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "SkDataPixelRef.h"
-#include "SkData.h"
-#include "SkFlattenableBuffers.h"
-
-SkDataPixelRef::SkDataPixelRef(const SkImageInfo& info, SkData* data)
- : INHERITED(info)
- , fData(data)
-{
- fData->ref();
- this->setPreLocked(const_cast<void*>(fData->data()), NULL);
-}
-
-SkDataPixelRef::~SkDataPixelRef() {
- fData->unref();
-}
-
-void* SkDataPixelRef::onLockPixels(SkColorTable** ct) {
- *ct = NULL;
- return const_cast<void*>(fData->data());
-}
-
-void SkDataPixelRef::onUnlockPixels() {
- // nothing to do
-}
-
-size_t SkDataPixelRef::getAllocatedSizeInBytes() const {
- return fData ? fData->size() : 0;
-}
-
-void SkDataPixelRef::flatten(SkFlattenableWriteBuffer& buffer) const {
- this->INHERITED::flatten(buffer);
- buffer.writeDataAsByteArray(fData);
-}
-
-SkDataPixelRef::SkDataPixelRef(SkFlattenableReadBuffer& buffer)
- : INHERITED(buffer, NULL) {
- fData = buffer.readByteArrayAsData();
- this->setPreLocked(const_cast<void*>(fData->data()), NULL);
-}
« no previous file with comments | « src/image/SkDataPixelRef.h ('k') | src/image/SkImage_Raster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698