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 "cc/tiled_layer_impl.h" | 5 #include "cc/tiled_layer_impl.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
9 #include "cc/append_quads_data.h" | 9 #include "cc/append_quads_data.h" |
10 #include "cc/checkerboard_draw_quad.h" | 10 #include "cc/checkerboard_draw_quad.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 bool clipped = false; | 189 bool clipped = false; |
190 gfx::QuadF visibleContentInTargetQuad = MathUtil::mapQuad(drawTransf
orm(), gfx::QuadF(visibleContentRect()), clipped); | 190 gfx::QuadF visibleContentInTargetQuad = MathUtil::mapQuad(drawTransf
orm(), gfx::QuadF(visibleContentRect()), clipped); |
191 bool isAxisAlignedInTarget = !clipped && visibleContentInTargetQuad.
IsRectilinear(); | 191 bool isAxisAlignedInTarget = !clipped && visibleContentInTargetQuad.
IsRectilinear(); |
192 bool useAA = m_tiler->hasBorderTexels() && !isAxisAlignedInTarget; | 192 bool useAA = m_tiler->hasBorderTexels() && !isAxisAlignedInTarget; |
193 | 193 |
194 bool leftEdgeAA = !i && useAA; | 194 bool leftEdgeAA = !i && useAA; |
195 bool topEdgeAA = !j && useAA; | 195 bool topEdgeAA = !j && useAA; |
196 bool rightEdgeAA = i == m_tiler->numTilesX() - 1 && useAA; | 196 bool rightEdgeAA = i == m_tiler->numTilesX() - 1 && useAA; |
197 bool bottomEdgeAA = j == m_tiler->numTilesY() - 1 && useAA; | 197 bool bottomEdgeAA = j == m_tiler->numTilesY() - 1 && useAA; |
198 | 198 |
199 const GLint textureFilter = m_tiler->hasBorderTexels() ? GL_LINEAR :
GL_NEAREST; | 199 quadSink.append(TileDrawQuad::create(sharedQuadState, tileRect, tile
OpaqueRect, tile->resourceId(), textureOffset, textureSize, tile->contentsSwizzl
ed(), leftEdgeAA, topEdgeAA, rightEdgeAA, bottomEdgeAA).PassAs<DrawQuad>(), appe
ndQuadsData); |
200 quadSink.append(TileDrawQuad::create(sharedQuadState, tileRect, tile
OpaqueRect, tile->resourceId(), textureOffset, textureSize, textureFilter, tile-
>contentsSwizzled(), leftEdgeAA, topEdgeAA, rightEdgeAA, bottomEdgeAA).PassAs<Dr
awQuad>(), appendQuadsData); | |
201 } | 200 } |
202 } | 201 } |
203 } | 202 } |
204 | 203 |
205 void TiledLayerImpl::setTilingData(const LayerTilingData& tiler) | 204 void TiledLayerImpl::setTilingData(const LayerTilingData& tiler) |
206 { | 205 { |
207 if (m_tiler) | 206 if (m_tiler) |
208 m_tiler->reset(); | 207 m_tiler->reset(); |
209 else | 208 else |
210 m_tiler = LayerTilingData::create(tiler.tileSize(), tiler.hasBorderTexel
s() ? LayerTilingData::HasBorderTexels : LayerTilingData::NoBorderTexels); | 209 m_tiler = LayerTilingData::create(tiler.tileSize(), tiler.hasBorderTexel
s() ? LayerTilingData::HasBorderTexels : LayerTilingData::NoBorderTexels); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 { | 243 { |
245 m_tiler->reset(); | 244 m_tiler->reset(); |
246 } | 245 } |
247 | 246 |
248 const char* TiledLayerImpl::layerTypeAsString() const | 247 const char* TiledLayerImpl::layerTypeAsString() const |
249 { | 248 { |
250 return "ContentLayer"; | 249 return "ContentLayer"; |
251 } | 250 } |
252 | 251 |
253 } // namespace cc | 252 } // namespace cc |
OLD | NEW |