summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/context
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2012-07-19 10:39:31 -0700
committerChris Craik <ccraik@google.com>2012-07-19 14:18:38 -0700
commitf899e6e3a8952453ea79363d36a4d171eebb0fbb (patch)
treeaabddfb4a019dd9a51cf7abbc69ad87bbd6a4abd /Source/WebCore/platform/graphics/android/context
parentcbf95b35591b40a9424e54d765694b378ef11966 (diff)
downloadexternal_webkit-f899e6e3a8952453ea79363d36a4d171eebb0fbb.zip
external_webkit-f899e6e3a8952453ea79363d36a4d171eebb0fbb.tar.gz
external_webkit-f899e6e3a8952453ea79363d36a4d171eebb0fbb.tar.bz2
Perform check for text/content on recording context PicturePiles
Only implemented for now when USE_RECORDING_CONTEXT is enabled. Standard SkPicture PicturePile implementation defaults to hasText = hasContent = true. Change-Id: I535b53151963bf8c415e420c1d5a789954e98cbf
Diffstat (limited to 'Source/WebCore/platform/graphics/android/context')
-rw-r--r--Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp5
-rw-r--r--Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.h5
2 files changed, 10 insertions, 0 deletions
diff --git a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp
index ba7f1a9..fa42944 100644
--- a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp
+++ b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.cpp
@@ -163,6 +163,8 @@ PlatformGraphicsContextRecording::PlatformGraphicsContextRecording(Recording* re
, mRecording(recording)
, mOperationState(0)
, mOperationMatrix(0)
+ , m_hasText(false)
+ , m_isEmpty(true)
{
mRootMatrix.setIdentity();
if (mRecording)
@@ -189,6 +191,8 @@ void PlatformGraphicsContextRecording::endRecording(const SkRect& bounds)
GraphicsOperation::DrawComplexText* text = new GraphicsOperation::DrawComplexText(mPicture);
appendDrawingOperation(text, bounds);
mPicture = 0;
+
+ m_hasText = true;
}
@@ -584,6 +588,7 @@ void PlatformGraphicsContextRecording::appendDrawingOperation(
ALOGW("Empty bounds for %s(%s)!", operation->name(), operation->parameters().ascii().data());
return;
}
+ m_isEmpty = false;
SkRect bounds;
mCurrentMatrix->mapRect(&bounds, untranslatedBounds);
if (mRecordingStateStack.size()) {
diff --git a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.h b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.h
index 3affff3..3864571 100644
--- a/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.h
+++ b/Source/WebCore/platform/graphics/android/context/PlatformGraphicsContextRecording.h
@@ -136,6 +136,8 @@ public:
virtual void strokePath(const Path& pathToStroke);
virtual void strokeRect(const FloatRect& rect, float lineWidth);
+ bool hasText() { return m_hasText; }
+ bool isEmpty() { return m_isEmpty; }
private:
virtual bool shadowsIgnoreTransforms() const {
@@ -192,6 +194,9 @@ private:
Vector<RecordingState> mRecordingStateStack;
State* mOperationState;
SkMatrix* mOperationMatrix;
+
+ bool m_hasText;
+ bool m_isEmpty;
};
}