OLD | NEW |
---|---|
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "cc/tiled_layer_impl.h" | 7 #include "cc/tiled_layer_impl.h" |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
191 bool clipped = false; | 191 bool clipped = false; |
192 gfx::QuadF visibleContentInTargetQuad = MathUtil::mapQuad(drawTransf orm(), gfx::QuadF(visibleContentRect()), clipped); | 192 gfx::QuadF visibleContentInTargetQuad = MathUtil::mapQuad(drawTransf orm(), gfx::QuadF(visibleContentRect()), clipped); |
193 bool isAxisAlignedInTarget = !clipped && visibleContentInTargetQuad. IsRectilinear(); | 193 bool isAxisAlignedInTarget = !clipped && visibleContentInTargetQuad. IsRectilinear(); |
194 bool useAA = m_tiler->hasBorderTexels() && !isAxisAlignedInTarget; | 194 bool useAA = m_tiler->hasBorderTexels() && !isAxisAlignedInTarget; |
195 | 195 |
196 bool leftEdgeAA = !i && useAA; | 196 bool leftEdgeAA = !i && useAA; |
197 bool topEdgeAA = !j && useAA; | 197 bool topEdgeAA = !j && useAA; |
198 bool rightEdgeAA = i == m_tiler->numTilesX() - 1 && useAA; | 198 bool rightEdgeAA = i == m_tiler->numTilesX() - 1 && useAA; |
199 bool bottomEdgeAA = j == m_tiler->numTilesY() - 1 && useAA; | 199 bool bottomEdgeAA = j == m_tiler->numTilesY() - 1 && useAA; |
200 | 200 |
201 const GLint textureFilter = m_tiler->hasBorderTexels() ? GL_LINEAR : GL_NEAREST; | 201 const GLint textureFilter = m_tiler->hasBorderTexels() && !drawTrans form().isIdentityOrTranslation() ? GL_LINEAR : GL_NEAREST; |
jamesr
2012/11/09 18:40:09
for non-integer translations we still need GL_LINE
Sami
2012/11/11 16:56:27
Excellent point. I've changed this to use isIntege
| |
202 quadSink.append(TileDrawQuad::create(sharedQuadState, tileRect, tile OpaqueRect, tile->resourceId(), textureOffset, textureSize, textureFilter, tile- >contentsSwizzled(), leftEdgeAA, topEdgeAA, rightEdgeAA, bottomEdgeAA).PassAs<Dr awQuad>(), appendQuadsData); | 202 quadSink.append(TileDrawQuad::create(sharedQuadState, tileRect, tile OpaqueRect, tile->resourceId(), textureOffset, textureSize, textureFilter, tile- >contentsSwizzled(), leftEdgeAA, topEdgeAA, rightEdgeAA, bottomEdgeAA).PassAs<Dr awQuad>(), appendQuadsData); |
203 } | 203 } |
204 } | 204 } |
205 } | 205 } |
206 | 206 |
207 void TiledLayerImpl::setTilingData(const LayerTilingData& tiler) | 207 void TiledLayerImpl::setTilingData(const LayerTilingData& tiler) |
208 { | 208 { |
209 if (m_tiler) | 209 if (m_tiler) |
210 m_tiler->reset(); | 210 m_tiler->reset(); |
211 else | 211 else |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
246 { | 246 { |
247 m_tiler->reset(); | 247 m_tiler->reset(); |
248 } | 248 } |
249 | 249 |
250 const char* TiledLayerImpl::layerTypeAsString() const | 250 const char* TiledLayerImpl::layerTypeAsString() const |
251 { | 251 { |
252 return "ContentLayer"; | 252 return "ContentLayer"; |
253 } | 253 } |
254 | 254 |
255 } // namespace cc | 255 } // namespace cc |
OLD | NEW |