summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/context/GraphicsOperation.h
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2012-08-14 11:13:34 -0700
committerJohn Reck <jreck@google.com>2012-08-14 11:24:14 -0700
commitb0a56fa335e9435238de5f2cde15076488057c52 (patch)
tree40d559862fe06c55273a8c03482a9c48d0096ee9 /Source/WebCore/platform/graphics/android/context/GraphicsOperation.h
parentfcadd7a73d414109c41d46fcad0d199ddc656a34 (diff)
downloadexternal_webkit-b0a56fa335e9435238de5f2cde15076488057c52.zip
external_webkit-b0a56fa335e9435238de5f2cde15076488057c52.tar.gz
external_webkit-b0a56fa335e9435238de5f2cde15076488057c52.tar.bz2
Memory usage improvements
Share SkPaints between drawPosText calls Change-Id: Idf25c937a70e2969a864c829e566688b977720c0
Diffstat (limited to 'Source/WebCore/platform/graphics/android/context/GraphicsOperation.h')
-rw-r--r--Source/WebCore/platform/graphics/android/context/GraphicsOperation.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/WebCore/platform/graphics/android/context/GraphicsOperation.h b/Source/WebCore/platform/graphics/android/context/GraphicsOperation.h
index c9c382a..c70c295 100644
--- a/Source/WebCore/platform/graphics/android/context/GraphicsOperation.h
+++ b/Source/WebCore/platform/graphics/android/context/GraphicsOperation.h
@@ -586,11 +586,11 @@ private:
class DrawPosText : public Operation {
public:
DrawPosText(const void* text, size_t byteLength,
- const SkPoint pos[], const SkPaint& paint)
+ const SkPoint pos[], const SkPaint* paint)
: m_byteLength(byteLength)
, m_paint(paint)
{
- size_t points = paint.countText(text, byteLength);
+ size_t points = m_paint->countText(text, byteLength);
m_pos = new SkPoint[points];
memcpy(m_pos, pos, sizeof(SkPoint) * points);
m_text = malloc(byteLength);
@@ -598,7 +598,7 @@ public:
}
~DrawPosText() { delete m_pos; free(m_text); }
virtual bool applyImpl(PlatformGraphicsContext* context) {
- context->drawPosText(m_text, m_byteLength, m_pos, m_paint);
+ context->drawPosText(m_text, m_byteLength, m_pos, *m_paint);
return true;
}
TYPE(DrawPosTextOperation)
@@ -606,7 +606,7 @@ private:
void* m_text;
size_t m_byteLength;
SkPoint* m_pos;
- SkPaint m_paint;
+ const SkPaint* m_paint;
};
}