fix size_t/int warnings in pictures
BUG=skia:
R=robertphillips@google.com
Author: reed@google.com
Review URL: https://codereview.chromium.org/244273002
git-svn-id: http://skia.googlecode.com/svn/trunk@14302 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/SkPictureRecord.h b/src/core/SkPictureRecord.h
index 2614496..aba14e3 100644
--- a/src/core/SkPictureRecord.h
+++ b/src/core/SkPictureRecord.h
@@ -100,7 +100,7 @@
private:
void handleOptimization(int opt);
- int recordRestoreOffsetPlaceholder(SkRegion::Op);
+ size_t recordRestoreOffsetPlaceholder(SkRegion::Op);
void fillRestoreOffsetPlaceholdersForCurrentStackLevel(uint32_t restoreOffset);
#ifndef SK_COLLAPSE_MATRIX_CLIP_STATE
@@ -125,7 +125,7 @@
* end of blocks could go unused). Possibly add a second addDraw that
* operates in this manner.
*/
- size_t addDraw(DrawType drawType, uint32_t* size) {
+ size_t addDraw(DrawType drawType, size_t* size) {
size_t offset = fWriter.bytesWritten();
this->predrawNotify();
@@ -140,9 +140,9 @@
if (0 != (*size & ~MASK_24) || *size == MASK_24) {
fWriter.writeInt(PACK_8_24(drawType, MASK_24));
*size += 1;
- fWriter.writeInt(*size);
+ fWriter.writeInt(SkToU32(*size));
} else {
- fWriter.writeInt(PACK_8_24(drawType, *size));
+ fWriter.writeInt(PACK_8_24(drawType, SkToU32(*size)));
}
return offset;
@@ -206,7 +206,7 @@
void validateRegions() const;
#else
public:
- void validate(size_t initialOffset, uint32_t size) const {
+ void validate(size_t initialOffset, size_t size) const {
SkASSERT(fWriter.bytesWritten() == initialOffset + size);
}
#endif
@@ -262,10 +262,10 @@
void recordConcat(const SkMatrix& matrix);
void recordTranslate(const SkMatrix& matrix);
void recordScale(const SkMatrix& matrix);
- int recordClipRect(const SkRect& rect, SkRegion::Op op, bool doAA);
- int recordClipRRect(const SkRRect& rrect, SkRegion::Op op, bool doAA);
- int recordClipPath(int pathID, SkRegion::Op op, bool doAA);
- int recordClipRegion(const SkRegion& region, SkRegion::Op op);
+ size_t recordClipRect(const SkRect& rect, SkRegion::Op op, bool doAA);
+ size_t recordClipRRect(const SkRRect& rrect, SkRegion::Op op, bool doAA);
+ size_t recordClipPath(int pathID, SkRegion::Op op, bool doAA);
+ size_t recordClipRegion(const SkRegion& region, SkRegion::Op op);
void recordSave(SaveFlags flags);
void recordSaveLayer(const SkRect* bounds, const SkPaint* paint, SaveFlags flags);
void recordRestore(bool fillInSkips = true);