void* pixels,
SkColorTable* color_table_,
size_t size,
+ size_t row_bites,
int fd,
uint32_t handle);
virtual ~DriSkPixelRef();
- virtual void* onLockPixels(SkColorTable** ct) OVERRIDE;
+ virtual bool onNewLockPixels(LockRec* rec) OVERRIDE;
virtual void onUnlockPixels() OVERRIDE;
SK_DECLARE_UNFLATTENABLE_OBJECT()
// Size of the allocated memory.
size_t size_;
+ // Number of bytes between subsequent rows in the bitmap (stride).
+ size_t row_bytes_;
+
// File descriptor to the graphics card used to allocate/deallocate the
// memory.
int fd_;
void* pixels,
SkColorTable* color_table,
size_t size,
+ size_t row_bytes,
int fd,
uint32_t handle)
: SkPixelRef(info),
pixels_(pixels),
color_table_(color_table),
size_(size),
+ row_bytes_(row_bytes),
fd_(fd),
handle_(handle) {
}
DestroyDumbBuffer(fd_, handle_);
}
-void* DriSkPixelRef::onLockPixels(SkColorTable** ct) {
- *ct = color_table_;
- return pixels_;
+bool DriSkPixelRef::onNewLockPixels(LockRec* rec) {
+ rec->fPixels = pixels_;
+ rec->fRowBytes = row_bytes_;
+ rec->fColorTable = color_table_;
+ return true;
}
void DriSkPixelRef::onUnlockPixels() {
pixels,
color_table,
bitmap->getSize(),
+ bitmap->rowBytes(),
bitmap->get_fd(),
bitmap->get_handle()))->unref();
bitmap->lockPixels();