From 3efc67e0caf0b63fe0350d6896d2cbc08661f5d7 Mon Sep 17 00:00:00 2001 From: Teng-Hui Zhu Date: Tue, 17 Apr 2012 10:38:53 -0700 Subject: Enable point sample when the texel and pixel is 1:1 mapping. Change-Id: I532ad6b038d3b141bd212c8c408533fec0e9616e --- .../WebCore/platform/graphics/android/rendering/TileTexture.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Source/WebCore/platform/graphics/android/rendering/TileTexture.cpp') 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); } } -- cgit v1.1