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

Side by Side Diff: cc/tiled_layer_impl.cc

Issue 11829047: cc: Move anti-aliasing decision to parent compositor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add crbug url Created 7 years, 11 months 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/picture_layer_impl.cc ('k') | no next file » | 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 // Keep track of how the top left has moved, so the texture can be 188 // Keep track of how the top left has moved, so the texture can be
189 // offset the same amount. 189 // offset the same amount.
190 gfx::Vector2d displayOffset = tileRect.origin() - displayRect.origin (); 190 gfx::Vector2d displayOffset = tileRect.origin() - displayRect.origin ();
191 gfx::Vector2d textureOffset = m_tiler->textureOffset(i, j) + display Offset; 191 gfx::Vector2d textureOffset = m_tiler->textureOffset(i, j) + display Offset;
192 gfx::RectF texCoordRect = gfx::RectF(tileRect.size()) + textureOffse t; 192 gfx::RectF texCoordRect = gfx::RectF(tileRect.size()) + textureOffse t;
193 193
194 float tileWidth = static_cast<float>(m_tiler->tileSize().width()); 194 float tileWidth = static_cast<float>(m_tiler->tileSize().width());
195 float tileHeight = static_cast<float>(m_tiler->tileSize().height()); 195 float tileHeight = static_cast<float>(m_tiler->tileSize().height());
196 gfx::Size textureSize(tileWidth, tileHeight); 196 gfx::Size textureSize(tileWidth, tileHeight);
197 197
198 bool clipped = false; 198 bool leftEdgeAA = !i;
199 gfx::QuadF visibleContentInTargetQuad = MathUtil::mapQuad(drawTransf orm(), gfx::QuadF(visibleContentRect()), clipped); 199 bool topEdgeAA = !j;
200 bool isAxisAlignedInTarget = !clipped && visibleContentInTargetQuad. IsRectilinear(); 200 bool rightEdgeAA = i == m_tiler->numTilesX() - 1;
201 bool useAA = m_tiler->hasBorderTexels() && !isAxisAlignedInTarget; 201 bool bottomEdgeAA = j == m_tiler->numTilesY() - 1;
202
203 bool leftEdgeAA = !i && useAA;
204 bool topEdgeAA = !j && useAA;
205 bool rightEdgeAA = i == m_tiler->numTilesX() - 1 && useAA;
206 bool bottomEdgeAA = j == m_tiler->numTilesY() - 1 && useAA;
207 202
208 scoped_ptr<TileDrawQuad> quad = TileDrawQuad::Create(); 203 scoped_ptr<TileDrawQuad> quad = TileDrawQuad::Create();
209 quad->SetNew(sharedQuadState, tileRect, tileOpaqueRect, tile->resour ceId(), texCoordRect, textureSize, tile->contentsSwizzled(), leftEdgeAA, topEdge AA, rightEdgeAA, bottomEdgeAA); 204 quad->SetNew(sharedQuadState, tileRect, tileOpaqueRect, tile->resour ceId(), texCoordRect, textureSize, tile->contentsSwizzled(), leftEdgeAA, topEdge AA, rightEdgeAA, bottomEdgeAA);
210 quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData); 205 quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData);
211 } 206 }
212 } 207 }
213 } 208 }
214 209
215 void TiledLayerImpl::setTilingData(const LayerTilingData& tiler) 210 void TiledLayerImpl::setTilingData(const LayerTilingData& tiler)
216 { 211 {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 m_tiler->reset(); 257 m_tiler->reset();
263 safeToDeleteDrawableTile = false; 258 safeToDeleteDrawableTile = false;
264 } 259 }
265 260
266 const char* TiledLayerImpl::layerTypeAsString() const 261 const char* TiledLayerImpl::layerTypeAsString() const
267 { 262 {
268 return "ContentLayer"; 263 return "ContentLayer";
269 } 264 }
270 265
271 } // namespace cc 266 } // namespace cc
OLDNEW
« no previous file with comments | « cc/picture_layer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698