Revert "Revert "add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers a warning""
This reverts commit 1e787c38fa71f2a21fd728f1b1d620b9b09b0d3d.
BUG=
Review URL: https://codereview.chromium.org/54603004
git-svn-id: http://skia.googlecode.com/svn/trunk@12057 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/SkBBoxHierarchyRecord.cpp b/src/core/SkBBoxHierarchyRecord.cpp
index 61a82ce..8e5861b 100644
--- a/src/core/SkBBoxHierarchyRecord.cpp
+++ b/src/core/SkBBoxHierarchyRecord.cpp
@@ -22,7 +22,7 @@
void SkBBoxHierarchyRecord::handleBBox(const SkRect& bounds) {
SkIRect r;
bounds.roundOut(&r);
- SkPictureStateTree::Draw* draw = fStateTree->appendDraw(this->writeStream().size());
+ SkPictureStateTree::Draw* draw = fStateTree->appendDraw(this->writeStream().bytesWritten());
fBoundingHierarchy->insert(draw, r, true);
}
@@ -33,7 +33,7 @@
int SkBBoxHierarchyRecord::saveLayer(const SkRect* bounds, const SkPaint* paint,
SaveFlags flags) {
- fStateTree->appendSaveLayer(this->writeStream().size());
+ fStateTree->appendSaveLayer(this->writeStream().bytesWritten());
return INHERITED::saveLayer(bounds, paint, flags);
}
@@ -80,27 +80,27 @@
bool SkBBoxHierarchyRecord::clipRect(const SkRect& rect,
SkRegion::Op op,
bool doAntiAlias) {
- fStateTree->appendClip(this->writeStream().size());
+ fStateTree->appendClip(this->writeStream().bytesWritten());
return INHERITED::clipRect(rect, op, doAntiAlias);
}
bool SkBBoxHierarchyRecord::clipRegion(const SkRegion& region,
SkRegion::Op op) {
- fStateTree->appendClip(this->writeStream().size());
+ fStateTree->appendClip(this->writeStream().bytesWritten());
return INHERITED::clipRegion(region, op);
}
bool SkBBoxHierarchyRecord::clipPath(const SkPath& path,
SkRegion::Op op,
bool doAntiAlias) {
- fStateTree->appendClip(this->writeStream().size());
+ fStateTree->appendClip(this->writeStream().bytesWritten());
return INHERITED::clipPath(path, op, doAntiAlias);
}
bool SkBBoxHierarchyRecord::clipRRect(const SkRRect& rrect,
SkRegion::Op op,
bool doAntiAlias) {
- fStateTree->appendClip(this->writeStream().size());
+ fStateTree->appendClip(this->writeStream().bytesWritten());
return INHERITED::clipRRect(rrect, op, doAntiAlias);
}
@@ -109,7 +109,7 @@
// SkPicture has rewound its command stream. To match that rewind in the
// BBH, we rewind all draws that reference commands that were recorded
// past the point to which the SkPicture has rewound, which is given by
- // writeStream().size().
+ // writeStream().bytesWritten().
SkPictureStateTree::Draw* draw = static_cast<SkPictureStateTree::Draw*>(data);
- return draw->fOffset >= writeStream().size();
+ return draw->fOffset >= writeStream().bytesWritten();
}
diff --git a/src/core/SkBBoxRecord.cpp b/src/core/SkBBoxRecord.cpp
index 1e6c69b..2349b1c 100644
--- a/src/core/SkBBoxRecord.cpp
+++ b/src/core/SkBBoxRecord.cpp
@@ -32,7 +32,7 @@
// path's device-space bounding box.
SkIRect clipBounds;
if (this->getClipDeviceBounds(&clipBounds)) {
- this->handleBBox(SkRect::MakeFromIRect(clipBounds));
+ this->handleBBox(SkRect::Make(clipBounds));
INHERITED::drawPath(path, paint);
}
} else if (this->transformBounds(path.getBounds(), &paint)) {
diff --git a/src/core/SkBitmap.cpp b/src/core/SkBitmap.cpp
index 2f1c9a4..bff0880 100644
--- a/src/core/SkBitmap.cpp
+++ b/src/core/SkBitmap.cpp
@@ -502,11 +502,11 @@
// This is intended to be a size_t version of ComputeSafeSize64(), just
// faster. The computation is meant to be identical.
return (fHeight ? ((fHeight - 1) * fRowBytes) +
- ComputeRowBytes(getConfig(), fWidth): 0);
+ ComputeRowBytes(this->config(), fWidth): 0);
}
Sk64 SkBitmap::getSafeSize64() const {
- return ComputeSafeSize64(getConfig(), fWidth, fHeight, fRowBytes);
+ return ComputeSafeSize64(this->config(), fWidth, fHeight, fRowBytes);
}
bool SkBitmap::copyPixelsTo(void* const dst, size_t dstSize,
@@ -516,12 +516,12 @@
dstRowBytes = fRowBytes;
}
- if (dstRowBytes < ComputeRowBytes(getConfig(), fWidth) ||
+ if (dstRowBytes < ComputeRowBytes(this->config(), fWidth) ||
dst == NULL || (getPixels() == NULL && pixelRef() == NULL))
return false;
if (!preserveDstPad && static_cast<uint32_t>(dstRowBytes) == fRowBytes) {
- size_t safeSize = getSafeSize();
+ size_t safeSize = this->getSafeSize();
if (safeSize > dstSize || safeSize == 0)
return false;
else {
@@ -535,12 +535,12 @@
}
} else {
// If destination has different stride than us, then copy line by line.
- if (ComputeSafeSize(getConfig(), fWidth, fHeight, dstRowBytes) >
+ if (ComputeSafeSize(this->config(), fWidth, fHeight, dstRowBytes) >
dstSize)
return false;
else {
// Just copy what we need on each line.
- size_t rowBytes = ComputeRowBytes(getConfig(), fWidth);
+ size_t rowBytes = ComputeRowBytes(this->config(), fWidth);
SkAutoLockPixels lock(*this);
const uint8_t* srcP = reinterpret_cast<const uint8_t*>(getPixels());
uint8_t* dstP = reinterpret_cast<uint8_t*>(dst);
@@ -874,7 +874,7 @@
* within the bounds of the SkPixelRef being used.
*/
static size_t get_sub_offset(const SkBitmap& bm, int x, int y) {
- switch (bm.getConfig()) {
+ switch (bm.config()) {
case SkBitmap::kA8_Config:
case SkBitmap:: kIndex8_Config:
// x is fine as is for the calculation
@@ -1005,7 +1005,7 @@
#include "SkPaint.h"
bool SkBitmap::canCopyTo(Config dstConfig) const {
- if (this->getConfig() == kNo_Config) {
+ if (this->config() == kNo_Config) {
return false;
}
@@ -1028,7 +1028,7 @@
}
// do not copy src if srcConfig == kA1_Config while dstConfig != kA1_Config
- if (this->getConfig() == kA1_Config && !sameConfigs) {
+ if (this->config() == kA1_Config && !sameConfigs) {
return false;
}
@@ -1305,7 +1305,7 @@
void (*proc)(SkBitmap* dst, int x, int y, const SkBitmap& src);
- const SkBitmap::Config config = this->getConfig();
+ const SkBitmap::Config config = this->config();
switch (config) {
case kARGB_8888_Config:
@@ -1444,7 +1444,7 @@
SkASSERT(alpha != NULL);
SkASSERT(alphaRowBytes >= src.width());
- SkBitmap::Config config = src.getConfig();
+ SkBitmap::Config config = src.config();
int w = src.width();
int h = src.height();
size_t rb = src.rowBytes();
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp
index ff68481..eac21e2 100644
--- a/src/core/SkBitmapDevice.cpp
+++ b/src/core/SkBitmapDevice.cpp
@@ -13,8 +13,8 @@
SK_DEFINE_INST_COUNT(SkBitmapDevice)
-#define CHECK_FOR_NODRAW_ANNOTATION(paint) \
- do { if (paint.isNoDrawAnnotation()) { return; } } while (0)
+#define CHECK_FOR_ANNOTATION(paint) \
+ do { if (paint.getAnnotation()) { return; } } while (0)
SkBitmapDevice::SkBitmapDevice(const SkBitmap& bitmap)
: fBitmap(bitmap) {
@@ -210,17 +210,17 @@
void SkBitmapDevice::drawPoints(const SkDraw& draw, SkCanvas::PointMode mode, size_t count,
const SkPoint pts[], const SkPaint& paint) {
- CHECK_FOR_NODRAW_ANNOTATION(paint);
+ CHECK_FOR_ANNOTATION(paint);
draw.drawPoints(mode, count, pts, paint);
}
void SkBitmapDevice::drawRect(const SkDraw& draw, const SkRect& r, const SkPaint& paint) {
- CHECK_FOR_NODRAW_ANNOTATION(paint);
+ CHECK_FOR_ANNOTATION(paint);
draw.drawRect(r, paint);
}
void SkBitmapDevice::drawOval(const SkDraw& draw, const SkRect& oval, const SkPaint& paint) {
- CHECK_FOR_NODRAW_ANNOTATION(paint);
+ CHECK_FOR_ANNOTATION(paint);
SkPath path;
path.addOval(oval);
@@ -230,7 +230,7 @@
}
void SkBitmapDevice::drawRRect(const SkDraw& draw, const SkRRect& rrect, const SkPaint& paint) {
- CHECK_FOR_NODRAW_ANNOTATION(paint);
+ CHECK_FOR_ANNOTATION(paint);
SkPath path;
path.addRRect(rrect);
@@ -242,7 +242,7 @@
void SkBitmapDevice::drawPath(const SkDraw& draw, const SkPath& path,
const SkPaint& paint, const SkMatrix* prePathMatrix,
bool pathIsMutable) {
- CHECK_FOR_NODRAW_ANNOTATION(paint);
+ CHECK_FOR_ANNOTATION(paint);
draw.drawPath(path, paint, prePathMatrix, pathIsMutable);
}
diff --git a/src/core/SkBitmapHeap.cpp b/src/core/SkBitmapHeap.cpp
index f3428db..a171138 100644
--- a/src/core/SkBitmapHeap.cpp
+++ b/src/core/SkBitmapHeap.cpp
@@ -259,7 +259,7 @@
// copiedBitmap.setPixelRef(sharedPixelRef, originalBitmap.pixelRefOffset());
} else if (originalBitmap.empty()) {
copiedBitmap.reset();
- } else if (!originalBitmap.deepCopyTo(&copiedBitmap, originalBitmap.getConfig())) {
+ } else if (!originalBitmap.deepCopyTo(&copiedBitmap, originalBitmap.config())) {
return false;
}
copiedBitmap.setImmutable();
diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp
index 6ba82bf..f4e1a37 100644
--- a/src/core/SkBlitter.cpp
+++ b/src/core/SkBlitter.cpp
@@ -857,7 +857,7 @@
// which check, in case we're being called by a client with a dummy device
// (e.g. they have a bounder that always aborts the draw)
- if (SkBitmap::kNo_Config == device.getConfig()) {
+ if (SkBitmap::kNo_Config == device.config()) {
SK_PLACEMENT_NEW(blitter, SkNullBlitter, storage, storageSize);
return blitter;
}
@@ -940,7 +940,7 @@
return blitter;
}
- switch (device.getConfig()) {
+ switch (device.config()) {
case SkBitmap::kA1_Config:
SK_PLACEMENT_NEW_ARGS(blitter, SkA1_Blitter,
storage, storageSize, (device, *paint));
diff --git a/src/core/SkBlitter_Sprite.cpp b/src/core/SkBlitter_Sprite.cpp
index db7cc69..9322e20 100644
--- a/src/core/SkBlitter_Sprite.cpp
+++ b/src/core/SkBlitter_Sprite.cpp
@@ -66,7 +66,7 @@
SkSpriteBlitter* blitter;
- switch (device.getConfig()) {
+ switch (device.config()) {
case SkBitmap::kRGB_565_Config:
blitter = SkSpriteBlitter::ChooseD16(source, paint, storage,
storageSize);
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 6036186..32a6e09 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1307,7 +1307,7 @@
SkRect deviceBounds;
SkIRect deviceIBounds;
this->getDevice()->getGlobalBounds(&deviceIBounds);
- deviceBounds = SkRect::MakeFromIRect(deviceIBounds);
+ deviceBounds = SkRect::Make(deviceIBounds);
this->SkCanvas::save(SkCanvas::kMatrix_SaveFlag);
// set the clip in device space
this->SkCanvas::setMatrix(SkMatrix::I());
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index d2d6180..df73f7a 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -1156,7 +1156,7 @@
void SkDraw::drawBitmapAsMask(const SkBitmap& bitmap,
const SkPaint& paint) const {
- SkASSERT(bitmap.getConfig() == SkBitmap::kA8_Config);
+ SkASSERT(bitmap.config() == SkBitmap::kA8_Config);
if (just_translate(*fMatrix, bitmap)) {
int ix = SkScalarRound(fMatrix->getTranslateX());
@@ -1264,7 +1264,7 @@
// nothing to draw
if (fRC->isEmpty() ||
bitmap.width() == 0 || bitmap.height() == 0 ||
- bitmap.getConfig() == SkBitmap::kNo_Config) {
+ bitmap.config() == SkBitmap::kNo_Config) {
return;
}
@@ -1290,7 +1290,7 @@
}
}
- if (bitmap.getConfig() != SkBitmap::kA8_Config &&
+ if (bitmap.config() != SkBitmap::kA8_Config &&
just_translate(matrix, bitmap)) {
//
// It is safe to call lock pixels now, since we know the matrix is
@@ -1323,7 +1323,7 @@
SkDraw draw(*this);
draw.fMatrix = &matrix;
- if (bitmap.getConfig() == SkBitmap::kA8_Config) {
+ if (bitmap.config() == SkBitmap::kA8_Config) {
draw.drawBitmapAsMask(bitmap, paint);
} else {
SkAutoBitmapShaderInstall install(bitmap, paint);
@@ -1343,7 +1343,7 @@
// nothing to draw
if (fRC->isEmpty() ||
bitmap.width() == 0 || bitmap.height() == 0 ||
- bitmap.getConfig() == SkBitmap::kNo_Config) {
+ bitmap.config() == SkBitmap::kNo_Config) {
return;
}
diff --git a/src/core/SkMipMap.cpp b/src/core/SkMipMap.cpp
index 0673c7e..4888b57 100644
--- a/src/core/SkMipMap.cpp
+++ b/src/core/SkMipMap.cpp
@@ -129,7 +129,7 @@
SkMipMap* SkMipMap::Build(const SkBitmap& src) {
void (*proc)(SkBitmap* dst, int x, int y, const SkBitmap& src);
- const SkBitmap::Config config = src.getConfig();
+ const SkBitmap::Config config = src.config();
switch (config) {
case SkBitmap::kARGB_8888_Config:
proc = downsampleby2_proc32;
diff --git a/src/core/SkOrderedWriteBuffer.cpp b/src/core/SkOrderedWriteBuffer.cpp
index 1c15e43..25ca769 100644
--- a/src/core/SkOrderedWriteBuffer.cpp
+++ b/src/core/SkOrderedWriteBuffer.cpp
@@ -310,10 +310,10 @@
// make room for the size of the flattened object
(void)fWriter.reserve(sizeof(uint32_t));
// record the current size, so we can subtract after the object writes.
- uint32_t offset = fWriter.size();
+ uint32_t offset = fWriter.bytesWritten();
// now flatten the object
flattenObject(flattenable, *this);
- uint32_t objSize = fWriter.size() - offset;
+ uint32_t objSize = fWriter.bytesWritten() - offset;
// record the obj's size
*fWriter.peek32(offset - sizeof(uint32_t)) = objSize;
}
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index 83f481a..94dd651 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -97,7 +97,8 @@
}
~SkAutoPathBoundsUpdate() {
- fPath->setIsConvex(fDegenerate);
+ fPath->setConvexity(fDegenerate ? SkPath::kConvex_Convexity
+ : SkPath::kUnknown_Convexity);
if (fEmpty || fHasValidBounds) {
fPath->setBounds(fRect);
}
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp
index 4ce29c8..f2d959d 100644
--- a/src/core/SkPicturePlayback.cpp
+++ b/src/core/SkPicturePlayback.cpp
@@ -66,10 +66,10 @@
record.dumpPaints();
#endif
- record.validate(record.writeStream().size(), 0);
+ record.validate(record.writeStream().bytesWritten(), 0);
const SkWriter32& writer = record.writeStream();
init();
- if (writer.size() == 0) {
+ if (writer.bytesWritten() == 0) {
fOpData = SkData::NewEmpty();
return;
}
@@ -85,7 +85,7 @@
}
{
- size_t size = writer.size();
+ size_t size = writer.bytesWritten();
void* buffer = sk_malloc_throw(size);
writer.flatten(buffer);
SkASSERT(!fOpData);
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
index f7a7633..c59dfe3 100644
--- a/src/core/SkPictureRecord.cpp
+++ b/src/core/SkPictureRecord.cpp
@@ -146,7 +146,7 @@
int SkPictureRecord::save(SaveFlags flags) {
// record the offset to us, making it non-positive to distinguish a save
// from a clip entry.
- fRestoreOffsetStack.push(-(int32_t)fWriter.size());
+ fRestoreOffsetStack.push(-(int32_t)fWriter.bytesWritten());
// op + flags
uint32_t size = kSaveSize;
@@ -161,7 +161,7 @@
SaveFlags flags) {
// record the offset to us, making it non-positive to distinguish a save
// from a clip entry.
- fRestoreOffsetStack.push(-(int32_t)fWriter.size());
+ fRestoreOffsetStack.push(-(int32_t)fWriter.bytesWritten());
// op + bool for 'bounds'
uint32_t size = 2 * kUInt32Size;
@@ -175,7 +175,7 @@
size_t initialOffset = this->addDraw(SAVE_LAYER, &size);
addRectPtr(bounds);
- SkASSERT(initialOffset+getPaintOffset(SAVE_LAYER, size) == fWriter.size());
+ SkASSERT(initialOffset+getPaintOffset(SAVE_LAYER, size) == fWriter.bytesWritten());
addPaintPtr(paint);
addInt(flags);
@@ -248,19 +248,19 @@
*/
static bool match(SkWriter32* writer, uint32_t offset,
int* pattern, CommandInfo* result, int numCommands) {
- SkASSERT(offset < writer->size());
+ SkASSERT(offset < writer->bytesWritten());
uint32_t curOffset = offset;
uint32_t curSize = 0;
int numMatched;
- for (numMatched = 0; numMatched < numCommands && curOffset < writer->size(); ++numMatched) {
+ for (numMatched = 0; numMatched < numCommands && curOffset < writer->bytesWritten(); ++numMatched) {
DrawType op = peek_op_and_size(writer, curOffset, &curSize);
- while (NOOP == op && curOffset < writer->size()) {
+ while (NOOP == op && curOffset < writer->bytesWritten()) {
curOffset += curSize;
op = peek_op_and_size(writer, curOffset, &curSize);
}
- if (curOffset >= writer->size()) {
+ if (curOffset >= writer->bytesWritten()) {
return false; // ran out of byte stream
}
@@ -285,7 +285,7 @@
}
curOffset += curSize;
- if (curOffset < writer->size()) {
+ if (curOffset < writer->bytesWritten()) {
// Something else between the last command and the end of the stream
return false;
}
@@ -464,7 +464,7 @@
gCollapseCalls += 1;
#endif
- int32_t restoreOffset = (int32_t)writer->size();
+ int32_t restoreOffset = (int32_t)writer->bytesWritten();
// back up to the save block
while (offset > 0) {
@@ -585,7 +585,7 @@
if ((*gPictureRecordOpts[opt].fProc)(&fWriter, fRestoreOffsetStack.top(), &fPaints)) {
// Some optimization fired so don't add the RESTORE
size = 0;
- initialOffset = fWriter.size();
+ initialOffset = fWriter.bytesWritten();
apply_optimization_to_bbh(gPictureRecordOpts[opt].fType,
fStateTree, fBoundingHierarchy);
break;
@@ -596,7 +596,7 @@
if ((fRecordFlags & SkPicture::kDisableRecordOptimizations_RecordingFlag) ||
SK_ARRAY_COUNT(gPictureRecordOpts) == opt) {
// No optimization fired so add the RESTORE
- fillRestoreOffsetPlaceholdersForCurrentStackLevel((uint32_t)fWriter.size());
+ fillRestoreOffsetPlaceholdersForCurrentStackLevel((uint32_t)fWriter.bytesWritten());
size = 1 * kUInt32Size; // RESTORE consists solely of 1 op code
initialOffset = this->addDraw(RESTORE, &size);
}
@@ -647,7 +647,7 @@
}
bool SkPictureRecord::concat(const SkMatrix& matrix) {
- this->validate(fWriter.size(), 0);
+ this->validate(fWriter.bytesWritten(), 0);
// op + matrix index
uint32_t size = 2 * kUInt32Size;
size_t initialOffset = this->addDraw(CONCAT, &size);
@@ -657,7 +657,7 @@
}
void SkPictureRecord::setMatrix(const SkMatrix& matrix) {
- this->validate(fWriter.size(), 0);
+ this->validate(fWriter.bytesWritten(), 0);
// op + matrix index
uint32_t size = 2 * kUInt32Size;
size_t initialOffset = this->addDraw(SET_MATRIX, &size);
@@ -734,7 +734,7 @@
prevOffset = 0;
}
- size_t offset = fWriter.size();
+ size_t offset = fWriter.bytesWritten();
addInt(prevOffset);
fRestoreOffsetStack.top() = offset;
}
@@ -840,7 +840,7 @@
// op + paint index
uint32_t size = 2 * kUInt32Size;
size_t initialOffset = this->addDraw(DRAW_PAINT, &size);
- SkASSERT(initialOffset+getPaintOffset(DRAW_PAINT, size) == fWriter.size());
+ SkASSERT(initialOffset+getPaintOffset(DRAW_PAINT, size) == fWriter.bytesWritten());
addPaint(paint);
this->validate(initialOffset, size);
}
@@ -850,7 +850,7 @@
// op + paint index + mode + count + point data
uint32_t size = 4 * kUInt32Size + count * sizeof(SkPoint);
size_t initialOffset = this->addDraw(DRAW_POINTS, &size);
- SkASSERT(initialOffset+getPaintOffset(DRAW_POINTS, size) == fWriter.size());
+ SkASSERT(initialOffset+getPaintOffset(DRAW_POINTS, size) == fWriter.bytesWritten());
addPaint(paint);
addInt(mode);
addInt(count);
@@ -862,7 +862,7 @@
// op + paint index + rect
uint32_t size = 2 * kUInt32Size + sizeof(oval);
size_t initialOffset = this->addDraw(DRAW_OVAL, &size);
- SkASSERT(initialOffset+getPaintOffset(DRAW_OVAL, size) == fWriter.size());
+ SkASSERT(initialOffset+getPaintOffset(DRAW_OVAL, size) == fWriter.bytesWritten());
addPaint(paint);
addRect(oval);
this->validate(initialOffset, size);
@@ -872,7 +872,7 @@
// op + paint index + rect
uint32_t size = 2 * kUInt32Size + sizeof(rect);
size_t initialOffset = this->addDraw(DRAW_RECT, &size);
- SkASSERT(initialOffset+getPaintOffset(DRAW_RECT, size) == fWriter.size());
+ SkASSERT(initialOffset+getPaintOffset(DRAW_RECT, size) == fWriter.bytesWritten());
addPaint(paint);
addRect(rect);
this->validate(initialOffset, size);
@@ -888,7 +888,7 @@
uint32_t initialOffset, size;
size = 2 * kUInt32Size + SkRRect::kSizeInMemory;
initialOffset = this->addDraw(DRAW_RRECT, &size);
- SkASSERT(initialOffset+getPaintOffset(DRAW_RRECT, size) == fWriter.size());
+ SkASSERT(initialOffset+getPaintOffset(DRAW_RRECT, size) == fWriter.bytesWritten());
addPaint(paint);
addRRect(rrect);
this->validate(initialOffset, size);
@@ -899,7 +899,7 @@
// op + paint index + path index
uint32_t size = 3 * kUInt32Size;
size_t initialOffset = this->addDraw(DRAW_PATH, &size);
- SkASSERT(initialOffset+getPaintOffset(DRAW_PATH, size) == fWriter.size());
+ SkASSERT(initialOffset+getPaintOffset(DRAW_PATH, size) == fWriter.bytesWritten());
addPaint(paint);
addPath(path);
this->validate(initialOffset, size);
@@ -910,7 +910,7 @@
// op + paint index + bitmap index + left + top
uint32_t size = 3 * kUInt32Size + 2 * sizeof(SkScalar);
size_t initialOffset = this->addDraw(DRAW_BITMAP, &size);
- SkASSERT(initialOffset+getPaintOffset(DRAW_BITMAP, size) == fWriter.size());
+ SkASSERT(initialOffset+getPaintOffset(DRAW_BITMAP, size) == fWriter.bytesWritten());
addPaintPtr(paint);
addBitmap(bitmap);
addScalar(left);
@@ -929,7 +929,7 @@
size += sizeof(dst); // + rect
size_t initialOffset = this->addDraw(DRAW_BITMAP_RECT_TO_RECT, &size);
- SkASSERT(initialOffset+getPaintOffset(DRAW_BITMAP_RECT_TO_RECT, size) == fWriter.size());
+ SkASSERT(initialOffset+getPaintOffset(DRAW_BITMAP_RECT_TO_RECT, size) == fWriter.bytesWritten());
addPaintPtr(paint);
addBitmap(bitmap);
addRectPtr(src); // may be null
@@ -943,7 +943,7 @@
// id + paint index + bitmap index + matrix index
uint32_t size = 4 * kUInt32Size;
size_t initialOffset = this->addDraw(DRAW_BITMAP_MATRIX, &size);
- SkASSERT(initialOffset+getPaintOffset(DRAW_BITMAP_MATRIX, size) == fWriter.size());
+ SkASSERT(initialOffset+getPaintOffset(DRAW_BITMAP_MATRIX, size) == fWriter.bytesWritten());
addPaintPtr(paint);
addBitmap(bitmap);
addMatrix(matrix);
@@ -955,7 +955,7 @@
// op + paint index + bitmap id + center + dst rect
uint32_t size = 3 * kUInt32Size + sizeof(center) + sizeof(dst);
size_t initialOffset = this->addDraw(DRAW_BITMAP_NINE, &size);
- SkASSERT(initialOffset+getPaintOffset(DRAW_BITMAP_NINE, size) == fWriter.size());
+ SkASSERT(initialOffset+getPaintOffset(DRAW_BITMAP_NINE, size) == fWriter.bytesWritten());
addPaintPtr(paint);
addBitmap(bitmap);
addIRect(center);
@@ -968,7 +968,7 @@
// op + paint index + bitmap index + left + top
uint32_t size = 5 * kUInt32Size;
size_t initialOffset = this->addDraw(DRAW_SPRITE, &size);
- SkASSERT(initialOffset+getPaintOffset(DRAW_SPRITE, size) == fWriter.size());
+ SkASSERT(initialOffset+getPaintOffset(DRAW_SPRITE, size) == fWriter.bytesWritten());
addPaintPtr(paint);
addBitmap(bitmap);
addInt(left);
@@ -1007,7 +1007,7 @@
DrawType op = fast ? DRAW_TEXT_TOP_BOTTOM : DRAW_TEXT;
size_t initialOffset = this->addDraw(op, &size);
- SkASSERT(initialOffset+getPaintOffset(op, size) == fWriter.size());
+ SkASSERT(initialOffset+getPaintOffset(op, size) == fWriter.bytesWritten());
const SkFlatData* flatPaintData = addPaint(paint);
SkASSERT(flatPaintData);
addText(text, byteLength);
@@ -1073,14 +1073,14 @@
op = DRAW_POS_TEXT;
}
size_t initialOffset = this->addDraw(op, &size);
- SkASSERT(initialOffset+getPaintOffset(op, size) == fWriter.size());
+ SkASSERT(initialOffset+getPaintOffset(op, size) == fWriter.bytesWritten());
const SkFlatData* flatPaintData = addPaint(paint);
SkASSERT(flatPaintData);
addText(text, byteLength);
addInt(points);
#ifdef SK_DEBUG_SIZE
- size_t start = fWriter.size();
+ size_t start = fWriter.bytesWritten();
#endif
if (canUseDrawH) {
if (fast) {
@@ -1097,7 +1097,7 @@
}
}
#ifdef SK_DEBUG_SIZE
- fPointBytes += fWriter.size() - start;
+ fPointBytes += fWriter.bytesWritten() - start;
fPointWrites += points;
#endif
this->validate(initialOffset, size);
@@ -1136,7 +1136,7 @@
addInt(points);
#ifdef SK_DEBUG_SIZE
- size_t start = fWriter.size();
+ size_t start = fWriter.bytesWritten();
#endif
if (fast) {
addFontMetricsTopBottom(paint, *flatPaintData, constY, constY);
@@ -1144,7 +1144,7 @@
addScalar(constY);
fWriter.writeMul4(xpos, points * sizeof(SkScalar));
#ifdef SK_DEBUG_SIZE
- fPointBytes += fWriter.size() - start;
+ fPointBytes += fWriter.bytesWritten() - start;
fPointWrites += points;
#endif
this->validate(initialOffset, size);
@@ -1156,7 +1156,7 @@
// op + paint index + length + 'length' worth of data + path index + matrix index
uint32_t size = 3 * kUInt32Size + SkAlign4(byteLength) + 2 * kUInt32Size;
size_t initialOffset = this->addDraw(DRAW_TEXT_ON_PATH, &size);
- SkASSERT(initialOffset+getPaintOffset(DRAW_TEXT_ON_PATH, size) == fWriter.size());
+ SkASSERT(initialOffset+getPaintOffset(DRAW_TEXT_ON_PATH, size) == fWriter.bytesWritten());
addPaint(paint);
addText(text, byteLength);
addPath(path);
@@ -1202,7 +1202,7 @@
}
size_t initialOffset = this->addDraw(DRAW_VERTICES, &size);
- SkASSERT(initialOffset+getPaintOffset(DRAW_VERTICES, size) == fWriter.size());
+ SkASSERT(initialOffset+getPaintOffset(DRAW_VERTICES, size) == fWriter.bytesWritten());
addPaint(paint);
addInt(flags);
addInt(vmode);
@@ -1311,11 +1311,11 @@
void SkPictureRecord::addPoint(const SkPoint& point) {
#ifdef SK_DEBUG_SIZE
- size_t start = fWriter.size();
+ size_t start = fWriter.bytesWritten();
#endif
fWriter.writePoint(point);
#ifdef SK_DEBUG_SIZE
- fPointBytes += fWriter.size() - start;
+ fPointBytes += fWriter.bytesWritten() - start;
fPointWrites++;
#endif
}
@@ -1330,11 +1330,11 @@
void SkPictureRecord::addRect(const SkRect& rect) {
#ifdef SK_DEBUG_SIZE
- size_t start = fWriter.size();
+ size_t start = fWriter.bytesWritten();
#endif
fWriter.writeRect(rect);
#ifdef SK_DEBUG_SIZE
- fRectBytes += fWriter.size() - start;
+ fRectBytes += fWriter.bytesWritten() - start;
fRectWrites++;
#endif
}
@@ -1365,12 +1365,12 @@
void SkPictureRecord::addText(const void* text, size_t byteLength) {
#ifdef SK_DEBUG_SIZE
- size_t start = fWriter.size();
+ size_t start = fWriter.bytesWritten();
#endif
addInt(byteLength);
fWriter.writePad(text, byteLength);
#ifdef SK_DEBUG_SIZE
- fTextBytes += fWriter.size() - start;
+ fTextBytes += fWriter.bytesWritten() - start;
fTextWrites++;
#endif
}
diff --git a/src/core/SkPictureRecord.h b/src/core/SkPictureRecord.h
index d80182c..da79fc1 100644
--- a/src/core/SkPictureRecord.h
+++ b/src/core/SkPictureRecord.h
@@ -131,7 +131,7 @@
* operates in this manner.
*/
size_t addDraw(DrawType drawType, uint32_t* size) {
- size_t offset = fWriter.size();
+ size_t offset = fWriter.bytesWritten();
this->predrawNotify();
@@ -212,7 +212,7 @@
#else
public:
void validate(size_t initialOffset, uint32_t size) const {
- SkASSERT(fWriter.size() == initialOffset + size);
+ SkASSERT(fWriter.bytesWritten() == initialOffset + size);
}
#endif
diff --git a/src/core/SkShader.cpp b/src/core/SkShader.cpp
index 32f3df4..8f6bfb5 100644
--- a/src/core/SkShader.cpp
+++ b/src/core/SkShader.cpp
@@ -51,7 +51,7 @@
const SkMatrix* m = &matrix;
SkMatrix total;
- fDeviceConfig = SkToU8(device.getConfig());
+ fDeviceConfig = SkToU8(device.config());
fPaintAlpha = paint.getAlpha();
if (this->hasLocalMatrix()) {
total.setConcat(matrix, this->getLocalMatrix());
diff --git a/src/core/SkSpriteBlitter_ARGB32.cpp b/src/core/SkSpriteBlitter_ARGB32.cpp
index 255ef26..8255336 100644
--- a/src/core/SkSpriteBlitter_ARGB32.cpp
+++ b/src/core/SkSpriteBlitter_ARGB32.cpp
@@ -277,7 +277,7 @@
SkColorFilter* filter = paint.getColorFilter();
SkSpriteBlitter* blitter = NULL;
- switch (source.getConfig()) {
+ switch (source.config()) {
case SkBitmap::kARGB_4444_Config:
if (alpha != 0xFF) {
return NULL; // we only have opaque sprites
diff --git a/src/core/SkSpriteBlitter_RGB16.cpp b/src/core/SkSpriteBlitter_RGB16.cpp
index 8cef767..2bce41e 100644
--- a/src/core/SkSpriteBlitter_RGB16.cpp
+++ b/src/core/SkSpriteBlitter_RGB16.cpp
@@ -324,7 +324,7 @@
SkSpriteBlitter* blitter = NULL;
unsigned alpha = paint.getAlpha();
- switch (source.getConfig()) {
+ switch (source.config()) {
case SkBitmap::kARGB_8888_Config:
SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_S32_BlitRowProc,
storage, storageSize, (source));