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

Side by Side Diff: cc/tiled_layer_impl.cc

Issue 11478016: Add a stat to the smoothness benchmark for avg number of missing tiles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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
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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 if (!tile || !tile->resourceId()) { 153 if (!tile || !tile->resourceId()) {
154 if (drawCheckerboardForMissingTiles()) { 154 if (drawCheckerboardForMissingTiles()) {
155 SkColor checkerColor; 155 SkColor checkerColor;
156 if (showDebugBorders()) 156 if (showDebugBorders())
157 checkerColor = tile ? DebugColors::InvalidatedTileChecke rboardColor() : DebugColors::EvictedTileCheckerboardColor(); 157 checkerColor = tile ? DebugColors::InvalidatedTileChecke rboardColor() : DebugColors::EvictedTileCheckerboardColor();
158 else 158 else
159 checkerColor = DebugColors::DefaultCheckerboardColor(); 159 checkerColor = DebugColors::DefaultCheckerboardColor();
160 160
161 scoped_ptr<CheckerboardDrawQuad> checkerboardQuad = Checkerb oardDrawQuad::Create(); 161 scoped_ptr<CheckerboardDrawQuad> checkerboardQuad = Checkerb oardDrawQuad::Create();
162 checkerboardQuad->SetNew(sharedQuadState, tileRect, checkerC olor); 162 checkerboardQuad->SetNew(sharedQuadState, tileRect, checkerC olor);
163 appendQuadsData.hadMissingTiles |= quadSink.append(checkerbo ardQuad.PassAs<DrawQuad>(), appendQuadsData); 163 if (quadSink.append(checkerboardQuad.PassAs<DrawQuad>(), app endQuadsData))
164 appendQuadsData.numMissingTiles++;
164 } else { 165 } else {
165 scoped_ptr<SolidColorDrawQuad> solidColorQuad = SolidColorDr awQuad::Create(); 166 scoped_ptr<SolidColorDrawQuad> solidColorQuad = SolidColorDr awQuad::Create();
166 solidColorQuad->SetNew(sharedQuadState, tileRect, background Color()); 167 solidColorQuad->SetNew(sharedQuadState, tileRect, background Color());
167 appendQuadsData.hadMissingTiles |= quadSink.append(solidColo rQuad.PassAs<DrawQuad>(), appendQuadsData); 168 if (quadSink.append(solidColorQuad.PassAs<DrawQuad>(), appen dQuadsData))
169 appendQuadsData.numMissingTiles++;
168 } 170 }
169 continue; 171 continue;
170 } 172 }
171 173
172 gfx::Rect tileOpaqueRect = contentsOpaque() ? tileRect : gfx::Inters ectRects(tile->opaqueRect(), contentRect); 174 gfx::Rect tileOpaqueRect = contentsOpaque() ? tileRect : gfx::Inters ectRects(tile->opaqueRect(), contentRect);
173 175
174 // Keep track of how the top left has moved, so the texture can be 176 // Keep track of how the top left has moved, so the texture can be
175 // offset the same amount. 177 // offset the same amount.
176 gfx::Vector2d displayOffset = tileRect.origin() - displayRect.origin (); 178 gfx::Vector2d displayOffset = tileRect.origin() - displayRect.origin ();
177 gfx::Vector2d textureOffset = m_tiler->textureOffset(i, j) + display Offset; 179 gfx::Vector2d textureOffset = m_tiler->textureOffset(i, j) + display Offset;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 { 242 {
241 m_tiler->reset(); 243 m_tiler->reset();
242 } 244 }
243 245
244 const char* TiledLayerImpl::layerTypeAsString() const 246 const char* TiledLayerImpl::layerTypeAsString() const
245 { 247 {
246 return "ContentLayer"; 248 return "ContentLayer";
247 } 249 }
248 250
249 } // namespace cc 251 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698