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

Side by Side Diff: cc/tiled_layer_impl.cc

Issue 12328098: cc: Moving anti-aliasing decision to parent compositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@solidaa
Patch Set: Rebase to tip of tree Created 7 years, 9 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
« no previous file with comments | « cc/tile_draw_quad.cc ('k') | content/common/cc_messages.h » ('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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 // Keep track of how the top left has moved, so the texture can be 211 // Keep track of how the top left has moved, so the texture can be
212 // offset the same amount. 212 // offset the same amount.
213 gfx::Vector2d displayOffset = tileRect.origin() - displayRect.origin (); 213 gfx::Vector2d displayOffset = tileRect.origin() - displayRect.origin ();
214 gfx::Vector2d textureOffset = m_tiler->textureOffset(i, j) + display Offset; 214 gfx::Vector2d textureOffset = m_tiler->textureOffset(i, j) + display Offset;
215 gfx::RectF texCoordRect = gfx::RectF(tileRect.size()) + textureOffse t; 215 gfx::RectF texCoordRect = gfx::RectF(tileRect.size()) + textureOffse t;
216 216
217 float tileWidth = static_cast<float>(m_tiler->tileSize().width()); 217 float tileWidth = static_cast<float>(m_tiler->tileSize().width());
218 float tileHeight = static_cast<float>(m_tiler->tileSize().height()); 218 float tileHeight = static_cast<float>(m_tiler->tileSize().height());
219 gfx::Size textureSize(tileWidth, tileHeight); 219 gfx::Size textureSize(tileWidth, tileHeight);
220 220
221 bool clipped = false;
222 gfx::QuadF visibleContentInTargetQuad = MathUtil::mapQuad(drawTransf orm(), gfx::QuadF(visibleContentRect()), clipped);
223 bool isAxisAlignedInTarget = !clipped && visibleContentInTargetQuad. IsRectilinear();
224 bool useAA = m_tiler->hasBorderTexels() && !isAxisAlignedInTarget;
225
226 bool leftEdgeAA = !i && useAA;
227 bool topEdgeAA = !j && useAA;
228 bool rightEdgeAA = i == m_tiler->numTilesX() - 1 && useAA;
229 bool bottomEdgeAA = j == m_tiler->numTilesY() - 1 && useAA;
230
231 scoped_ptr<TileDrawQuad> quad = TileDrawQuad::Create(); 221 scoped_ptr<TileDrawQuad> quad = TileDrawQuad::Create();
232 quad->SetNew(sharedQuadState, tileRect, tileOpaqueRect, tile->resour ceId(), texCoordRect, textureSize, tile->contentsSwizzled(), leftEdgeAA, topEdge AA, rightEdgeAA, bottomEdgeAA); 222 quad->SetNew(sharedQuadState, tileRect, tileOpaqueRect, tile->resour ceId(), texCoordRect, textureSize, tile->contentsSwizzled());
233 quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData); 223 quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData);
234 } 224 }
235 } 225 }
236 } 226 }
237 227
238 void TiledLayerImpl::setTilingData(const LayerTilingData& tiler) 228 void TiledLayerImpl::setTilingData(const LayerTilingData& tiler)
239 { 229 {
240 safeToDeleteDrawableTile = true; 230 safeToDeleteDrawableTile = true;
241 231
242 if (m_tiler) 232 if (m_tiler)
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 m_tiler->reset(); 275 m_tiler->reset();
286 safeToDeleteDrawableTile = false; 276 safeToDeleteDrawableTile = false;
287 } 277 }
288 278
289 const char* TiledLayerImpl::layerTypeAsString() const 279 const char* TiledLayerImpl::layerTypeAsString() const
290 { 280 {
291 return "ContentLayer"; 281 return "ContentLayer";
292 } 282 }
293 283
294 } // namespace cc 284 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tile_draw_quad.cc ('k') | content/common/cc_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698