diff options
author | Teng-Hui Zhu <ztenghui@google.com> | 2012-04-17 10:38:53 -0700 |
---|---|---|
committer | Teng-Hui Zhu <ztenghui@google.com> | 2012-04-17 14:47:34 -0700 |
commit | 3efc67e0caf0b63fe0350d6896d2cbc08661f5d7 (patch) | |
tree | 041cfeae876cee9bde2f6c117a52b9657b36fe3a /Source/WebCore/platform/graphics/android/rendering/TileTexture.cpp | |
parent | c9efa1bf37f8bbf12a5b5dd465cbfb06c8053d9c (diff) | |
download | external_webkit-3efc67e0caf0b63fe0350d6896d2cbc08661f5d7.zip external_webkit-3efc67e0caf0b63fe0350d6896d2cbc08661f5d7.tar.gz external_webkit-3efc67e0caf0b63fe0350d6896d2cbc08661f5d7.tar.bz2 |
Enable point sample when the texel and pixel is 1:1 mapping.
Change-Id: I532ad6b038d3b141bd212c8c408533fec0e9616e
Diffstat (limited to 'Source/WebCore/platform/graphics/android/rendering/TileTexture.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/android/rendering/TileTexture.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/WebCore/platform/graphics/android/rendering/TileTexture.cpp b/Source/WebCore/platform/graphics/android/rendering/TileTexture.cpp index 126a7ac..3dceda9 100644 --- a/Source/WebCore/platform/graphics/android/rendering/TileTexture.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/TileTexture.cpp @@ -120,7 +120,7 @@ void TileTexture::transferComplete() void TileTexture::drawGL(bool isLayer, const SkRect& rect, float opacity, const TransformationMatrix* transform, - bool forceBlending) + bool forceBlending, bool usePointSampling) { ShaderProgram* shader = TilesManager::instance()->shader(); @@ -132,14 +132,15 @@ void TileTexture::drawGL(bool isLayer, const SkRect& rect, float opacity, // For base layer, we just follow the forceBlending, otherwise, blending is // always turned on. // TODO: Don't blend tiles if they are fully opaque. - forceBlending |= isLayer; + bool useBlending = forceBlending || isLayer; DrawQuadData commonData(isLayer ? LayerQuad : BaseQuad, transform, &rect, - opacity, forceBlending); + opacity, useBlending); if (isPureColor()) { PureColorQuadData data(commonData, pureColor()); shader->drawQuad(&data); } else { - TextureQuadData data(commonData, m_ownTextureId, GL_TEXTURE_2D, GL_LINEAR); + GLint filter = usePointSampling ? GL_NEAREST : GL_LINEAR; + TextureQuadData data(commonData, m_ownTextureId, GL_TEXTURE_2D, filter); shader->drawQuad(&data); } } |