| Index: src/core/SkPictureRecord.cpp
|
| diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
|
| index 5ce35d6fe80a51aba1ea0e32534a6d4dce024b10..6f88bdfcf9e872975f66e1d163d4fc2c16803cdf 100644
|
| --- a/src/core/SkPictureRecord.cpp
|
| +++ b/src/core/SkPictureRecord.cpp
|
| @@ -205,13 +205,13 @@ bool SkPictureRecord::isDrawingToLayer() const {
|
| * Read the op code from 'offset' in 'writer' and extract the size too.
|
| */
|
| static DrawType peek_op_and_size(SkWriter32* writer, int32_t offset, uint32_t* size) {
|
| - uint32_t peek = writer->read32At(offset);
|
| + uint32_t peek = writer->readTAt<uint32_t>(offset);
|
|
|
| uint32_t op;
|
| UNPACK_8_24(peek, op, *size);
|
| if (MASK_24 == *size) {
|
| // size required its own slot right after the op code
|
| - *size = writer->read32At(offset+kUInt32Size);
|
| + *size = writer->readTAt<uint32_t>(offset+kUInt32Size);
|
| }
|
| return (DrawType) op;
|
| }
|
| @@ -314,7 +314,7 @@ static bool remove_save_layer1(SkWriter32* writer, int32_t offset,
|
| // back up to the save block
|
| // TODO: add a stack to track save*/restore offsets rather than searching backwards
|
| while (offset > 0) {
|
| - offset = writer->read32At(offset);
|
| + offset = writer->readTAt<uint32_t>(offset);
|
| }
|
|
|
| int pattern[] = { SAVE_LAYER, kDRAW_BITMAP_FLAVOR, /* RESTORE */ };
|
| @@ -338,8 +338,8 @@ static bool remove_save_layer1(SkWriter32* writer, int32_t offset,
|
| * field alone so the NOOP can be skipped later.
|
| */
|
| static void convert_command_to_noop(SkWriter32* writer, uint32_t offset) {
|
| - uint32_t command = writer->read32At(offset);
|
| - writer->write32At(offset, (command & MASK_24) | (NOOP << 24));
|
| + uint32_t command = writer->readTAt<uint32_t>(offset);
|
| + writer->writeTAt<uint32_t>(offset, (command & MASK_24) | (NOOP << 24));
|
| }
|
|
|
| /*
|
| @@ -360,8 +360,8 @@ static bool merge_savelayer_paint_into_drawbitmp(SkWriter32* writer,
|
| uint32_t slPaintOffset = getPaintOffset(SAVE_LAYER, saveLayerInfo.fSize);
|
|
|
| // we have a match, now we need to get the paints involved
|
| - uint32_t dbmPaintId = writer->read32At(dbmInfo.fOffset+dbmPaintOffset);
|
| - uint32_t saveLayerPaintId = writer->read32At(saveLayerInfo.fOffset+slPaintOffset);
|
| + uint32_t dbmPaintId = writer->readTAt<uint32_t>(dbmInfo.fOffset+dbmPaintOffset);
|
| + uint32_t saveLayerPaintId = writer->readTAt<uint32_t>(saveLayerInfo.fOffset+slPaintOffset);
|
|
|
| if (0 == saveLayerPaintId) {
|
| // In this case the saveLayer/restore isn't needed at all - just kill the saveLayer
|
| @@ -374,7 +374,7 @@ static bool merge_savelayer_paint_into_drawbitmp(SkWriter32* writer,
|
| // In this case just make the DBM* use the saveLayer's paint, kill the saveLayer
|
| // and signal the caller (by returning true) to not add the RESTORE op
|
| convert_command_to_noop(writer, saveLayerInfo.fOffset);
|
| - writer->write32At(dbmInfo.fOffset+dbmPaintOffset, saveLayerPaintId);
|
| + writer->writeTAt<uint32_t>(dbmInfo.fOffset + dbmPaintOffset, saveLayerPaintId);
|
| return true;
|
| }
|
|
|
| @@ -407,7 +407,7 @@ static bool merge_savelayer_paint_into_drawbitmp(SkWriter32* writer,
|
|
|
| // kill the saveLayer and alter the DBMR2R's paint to be the modified one
|
| convert_command_to_noop(writer, saveLayerInfo.fOffset);
|
| - writer->write32At(dbmInfo.fOffset+dbmPaintOffset, data->index());
|
| + writer->writeTAt<uint32_t>(dbmInfo.fOffset + dbmPaintOffset, data->index());
|
| return true;
|
| }
|
|
|
| @@ -428,7 +428,7 @@ static bool remove_save_layer2(SkWriter32* writer, int32_t offset,
|
| // back up to the save block
|
| // TODO: add a stack to track save*/restore offsets rather than searching backwards
|
| while (offset > 0) {
|
| - offset = writer->read32At(offset);
|
| + offset = writer->readTAt<uint32_t>(offset);
|
| }
|
|
|
| int pattern[] = { SAVE_LAYER, SAVE, CLIP_RECT, kDRAW_BITMAP_FLAVOR, RESTORE, /* RESTORE */ };
|
| @@ -465,7 +465,7 @@ static bool collapse_save_clip_restore(SkWriter32* writer, int32_t offset,
|
|
|
| // back up to the save block
|
| while (offset > 0) {
|
| - offset = writer->read32At(offset);
|
| + offset = writer->readTAt<uint32_t>(offset);
|
| }
|
|
|
| // now offset points to a save
|
| @@ -480,7 +480,7 @@ static bool collapse_save_clip_restore(SkWriter32* writer, int32_t offset,
|
| SkASSERT(kSaveSize == opSize);
|
|
|
| // get the save flag (last 4-bytes of the space allocated for the opSize)
|
| - SkCanvas::SaveFlags saveFlags = (SkCanvas::SaveFlags) writer->read32At(offset+4);
|
| + SkCanvas::SaveFlags saveFlags = (SkCanvas::SaveFlags) writer->readTAt<uint32_t>(offset + 4);
|
| if (SkCanvas::kMatrixClip_SaveFlag != saveFlags) {
|
| // This function's optimization is only correct for kMatrixClip style saves.
|
| // TODO: set checkMatrix & checkClip booleans here and then check for the
|
| @@ -703,8 +703,8 @@ static bool regionOpExpands(SkRegion::Op op) {
|
| void SkPictureRecord::fillRestoreOffsetPlaceholdersForCurrentStackLevel(uint32_t restoreOffset) {
|
| int32_t offset = fRestoreOffsetStack.top();
|
| while (offset > 0) {
|
| - uint32_t peek = fWriter.read32At(offset);
|
| - fWriter.write32At(offset, restoreOffset);
|
| + uint32_t peek = fWriter.readTAt<uint32_t>(offset);
|
| + fWriter.writeTAt<uint32_t>(offset, restoreOffset);
|
| offset = peek;
|
| }
|
|
|
| @@ -1375,7 +1375,7 @@ void SkPictureRecord::addPoint(const SkPoint& point) {
|
| #ifdef SK_DEBUG_SIZE
|
| size_t start = fWriter.bytesWritten();
|
| #endif
|
| - fWriter.writePoint(point);
|
| + fWriter.writeT<SkPoint>(point);
|
| #ifdef SK_DEBUG_SIZE
|
| fPointBytes += fWriter.bytesWritten() - start;
|
| fPointWrites++;
|
| @@ -1394,7 +1394,7 @@ void SkPictureRecord::addRect(const SkRect& rect) {
|
| #ifdef SK_DEBUG_SIZE
|
| size_t start = fWriter.bytesWritten();
|
| #endif
|
| - fWriter.writeRect(rect);
|
| + fWriter.writeT<SkRect>(rect);
|
| #ifdef SK_DEBUG_SIZE
|
| fRectBytes += fWriter.bytesWritten() - start;
|
| fRectWrites++;
|
| @@ -1403,7 +1403,7 @@ void SkPictureRecord::addRect(const SkRect& rect) {
|
|
|
| void SkPictureRecord::addRectPtr(const SkRect* rect) {
|
| if (fWriter.writeBool(rect != NULL)) {
|
| - fWriter.writeRect(*rect);
|
| + fWriter.writeT<SkRect>(*rect);
|
| }
|
| }
|
|
|
|
|