diff options
author | Teng-Hui Zhu <ztenghui@google.com> | 2012-06-06 11:24:02 -0700 |
---|---|---|
committer | Teng-Hui Zhu <ztenghui@google.com> | 2012-06-07 12:23:20 -0700 |
commit | 750f81c3eb609bfd132182bbbb9b467455175498 (patch) | |
tree | 1c0f5672223b66964693ea536504ac6f6e750c54 /Source/WebCore/platform/graphics/android/rendering/DrawQuadData.h | |
parent | 6f60c96bbd87b5c54d89aeb23ace06ae3647e2f3 (diff) | |
download | external_webkit-750f81c3eb609bfd132182bbbb9b467455175498.zip external_webkit-750f81c3eb609bfd132182bbbb9b467455175498.tar.gz external_webkit-750f81c3eb609bfd132182bbbb9b467455175498.tar.bz2 |
Add fast drawing path for repeat background image.
In the slow draw path, we are drawing the small background image one by one.
Now in the fast path, we can use the GL shader to repeat the iamges.
bug:6579681
Change-Id: I8ab413bdd073cb867002b77b36d4a1361290ecb2
Diffstat (limited to 'Source/WebCore/platform/graphics/android/rendering/DrawQuadData.h')
-rw-r--r-- | Source/WebCore/platform/graphics/android/rendering/DrawQuadData.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Source/WebCore/platform/graphics/android/rendering/DrawQuadData.h b/Source/WebCore/platform/graphics/android/rendering/DrawQuadData.h index 719df14..65a0df7 100644 --- a/Source/WebCore/platform/graphics/android/rendering/DrawQuadData.h +++ b/Source/WebCore/platform/graphics/android/rendering/DrawQuadData.h @@ -93,6 +93,8 @@ public: virtual GLint textureFilter() const { return 0; } virtual GLenum textureTarget() const { return 0; } virtual FloatRect fillPortion() const { return m_fillPortion; } + virtual bool hasRepeatScale() const { return false; } + virtual FloatSize repeatScale() const { return FloatSize(); } private: DrawQuadType m_type; @@ -140,12 +142,15 @@ public: const TransformationMatrix* drawMatrix = 0, const SkRect* geometry = 0, float opacity = 1.0f, - bool forceBlending = true) - : DrawQuadData(type, drawMatrix, geometry, opacity, forceBlending) + bool forceBlending = true, + FloatRect fillPortion = FloatRect(0.0f, 0.0f, 1.0f, 1.0f), + FloatSize repeatScale = FloatSize()) + : DrawQuadData(type, drawMatrix, geometry, opacity, forceBlending, fillPortion) { m_textureId = textureId; m_textureTarget = textureTarget; m_textureFilter = textureFilter; + m_repeatScale = repeatScale; } TextureQuadData(const DrawQuadData& data, @@ -167,11 +172,13 @@ public: virtual GLenum textureTarget() const { return m_textureTarget; } void updateTextureId(int newId) { m_textureId = newId; } - + virtual bool hasRepeatScale() const { return !m_repeatScale.isEmpty(); } + virtual FloatSize repeatScale() const { return m_repeatScale; } private: int m_textureId; GLint m_textureFilter; GLenum m_textureTarget; + FloatSize m_repeatScale; }; } // namespace WebCore |