diff options
author | John Reck <jreck@google.com> | 2012-08-14 16:53:39 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2012-08-14 16:53:39 -0700 |
commit | 682a85cb3ff0b200d4fe0f7ef41a4e1c57dea233 (patch) | |
tree | d84cc68736e77e24f11348668dc9c6d6261e5441 /Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp | |
parent | b0a56fa335e9435238de5f2cde15076488057c52 (diff) | |
download | external_webkit-682a85cb3ff0b200d4fe0f7ef41a4e1c57dea233.zip external_webkit-682a85cb3ff0b200d4fe0f7ef41a4e1c57dea233.tar.gz external_webkit-682a85cb3ff0b200d4fe0f7ef41a4e1c57dea233.tar.bz2 |
Move text allocations to LinearAllocator
Change-Id: I3ef492679e94bdb452033ee3af3162b88d323d57
Diffstat (limited to 'Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp index 24ee47e..464224a 100644 --- a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp +++ b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp @@ -891,15 +891,20 @@ void PlatformGraphicsContextRecording::strokeRect(const FloatRect& rect, float l appendDrawingOperation(NEW_OP(StrokeRect)(rect, lineWidth), bounds); } -void PlatformGraphicsContextRecording::drawPosText(const void* text, size_t byteLength, - const SkPoint pos[], const SkPaint& inPaint) +void PlatformGraphicsContextRecording::drawPosText(const void* inText, size_t byteLength, + const SkPoint inPos[], const SkPaint& inPaint) { if (inPaint.getTextEncoding() != SkPaint::kGlyphID_TextEncoding) { ALOGE("Unsupported text encoding! %d", inPaint.getTextEncoding()); return; } - FloatRect bounds = approximateTextBounds(byteLength / sizeof(uint16_t), pos, inPaint); + FloatRect bounds = approximateTextBounds(byteLength / sizeof(uint16_t), inPos, inPaint); const SkPaint* paint = mRecording->recording()->getSkPaint(inPaint); + int posSize = sizeof(SkPoint) * paint->countText(inText, byteLength); + void* text = operationHeap()->alloc(posSize + byteLength); + SkPoint* pos = (SkPoint*) ((char*)text + byteLength); + memcpy(text, inText, byteLength); + memcpy(pos, inPos, posSize); appendDrawingOperation(NEW_OP(DrawPosText)(text, byteLength, pos, paint), bounds); } |