summaryrefslogtreecommitdiff
path: root/image/SkDataPixelRef.cpp
diff options
context:
space:
mode:
authorreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-11 18:19:10 +0000
committerreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-11 18:19:10 +0000
commit786f86cea3fa73c8a640abb4643bcb29a65906eb (patch)
tree8d3992b31d7c34fe1b1ab9626c17098485fccc92 /image/SkDataPixelRef.cpp
parenta9d4eb1e5feadbf92991880490cfd6c3295f07ad (diff)
downloadsrc-786f86cea3fa73c8a640abb4643bcb29a65906eb.tar.gz
Revert "PixelRef now returns (nearly) everything that is currently in SkBitmap. The goal is to refactor bitmap later to remove redundancy, and more interestingly, remove the chance for a disconnect between the actual (pixelref) rowbytes and config, and the one claimed by the bitmap."""""
This reverts commit d08eca87a0bef10112a211de540f89656a80b86a. BUG= Review URL: https://codereview.chromium.org/108303003 git-svn-id: http://skia.googlecode.com/svn/trunk/src@12623 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'image/SkDataPixelRef.cpp')
-rw-r--r--image/SkDataPixelRef.cpp25
1 files changed, 7 insertions, 18 deletions
diff --git a/image/SkDataPixelRef.cpp b/image/SkDataPixelRef.cpp
index 875f933b..7897bf93 100644
--- a/image/SkDataPixelRef.cpp
+++ b/image/SkDataPixelRef.cpp
@@ -9,25 +9,18 @@
#include "SkData.h"
#include "SkFlattenableBuffers.h"
-SkDataPixelRef::SkDataPixelRef(const SkImageInfo& info,
- SkData* data, size_t rowBytes)
- : INHERITED(info)
- , fData(data)
- , fRB(rowBytes)
-{
+SkDataPixelRef::SkDataPixelRef(SkData* data) : fData(data) {
fData->ref();
- this->setPreLocked(const_cast<void*>(fData->data()), rowBytes, NULL);
+ this->setPreLocked(const_cast<void*>(fData->data()), NULL);
}
SkDataPixelRef::~SkDataPixelRef() {
fData->unref();
}
-bool SkDataPixelRef::onNewLockPixels(LockRec* rec) {
- rec->fPixels = const_cast<void*>(fData->data());
- rec->fColorTable = NULL;
- rec->fRowBytes = fRB;
- return true;
+void* SkDataPixelRef::onLockPixels(SkColorTable** ct) {
+ *ct = NULL;
+ return const_cast<void*>(fData->data());
}
void SkDataPixelRef::onUnlockPixels() {
@@ -40,15 +33,11 @@ size_t SkDataPixelRef::getAllocatedSizeInBytes() const {
void SkDataPixelRef::flatten(SkFlattenableWriteBuffer& buffer) const {
this->INHERITED::flatten(buffer);
-
buffer.writeDataAsByteArray(fData);
- buffer.write32(fRB);
}
SkDataPixelRef::SkDataPixelRef(SkFlattenableReadBuffer& buffer)
- : INHERITED(buffer, NULL)
-{
+ : INHERITED(buffer, NULL) {
fData = buffer.readByteArrayAsData();
- fRB = buffer.read32();
- this->setPreLocked(const_cast<void*>(fData->data()), fRB, NULL);
+ this->setPreLocked(const_cast<void*>(fData->data()), NULL);
}