Index: src/utils/SkCanvasStateUtils.cpp |
diff --git a/src/utils/SkCanvasStateUtils.cpp b/src/utils/SkCanvasStateUtils.cpp |
index c62bc04e11a0bbcbf2f60a0c4d92b3f3f188af11..9c7d8fab3a10c9775dd71f2d82279920984348a0 100644 |
--- a/src/utils/SkCanvasStateUtils.cpp |
+++ b/src/utils/SkCanvasStateUtils.cpp |
@@ -171,7 +171,7 @@ static void setup_MC_state(SkMCState* state, const SkMatrix& matrix, const SkReg |
} |
// allocate memory for the clip then and copy them to the struct |
- state->clipRects = (ClipRect*) sk_malloc_throw(clipWriter.size()); |
+ state->clipRects = (ClipRect*) sk_malloc_throw(clipWriter.bytesWritten()); |
clipWriter.flatten(state->clipRects); |
} |
@@ -239,9 +239,9 @@ SkCanvasState* SkCanvasStateUtils::CaptureCanvasState(SkCanvas* canvas) { |
} |
// allocate memory for the layers and then and copy them to the struct |
- SkASSERT(layerWriter.size() == layerCount * sizeof(SkCanvasLayerState)); |
+ SkASSERT(layerWriter.bytesWritten() == layerCount * sizeof(SkCanvasLayerState)); |
canvasState->layerCount = layerCount; |
- canvasState->layers = (SkCanvasLayerState*) sk_malloc_throw(layerWriter.size()); |
+ canvasState->layers = (SkCanvasLayerState*) sk_malloc_throw(layerWriter.bytesWritten()); |
layerWriter.flatten(canvasState->layers); |
// for now, just ignore any client supplied DrawFilter. |