Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: cc/tiled_layer_impl.cc

Issue 11366199: Avoid redundantly setting tex parameters (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removes now-dead textureFilter code, tests that we don't call texParameteri during draw Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/tile_draw_quad.cc ('k') | webkit/tools/layout_tests/test_expectations.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/tile_draw_quad.cc ('k') | webkit/tools/layout_tests/test_expectations.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698