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

Unified Diff: src/image/SkDataPixelRef.cpp

Issue 108303003: Revert "PixelRef now returns (nearly) everything that is currently in SkBitmap. The goal is to refa… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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
index 875f933b9c1f6faa530cba41103bc8b632b4492f..7897bf93158437efa69abe1e8ea8a5baf5516ced 100644
--- a/src/image/SkDataPixelRef.cpp
+++ b/src/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);
}
« 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