| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 checkerColor = tile ? DebugColors::InvalidatedTileChecke
rboardColor() : DebugColors::EvictedTileCheckerboardColor(); | 159 checkerColor = tile ? DebugColors::InvalidatedTileChecke
rboardColor() : DebugColors::EvictedTileCheckerboardColor(); |
| 160 else | 160 else |
| 161 checkerColor = kTileCheckerboardColor; | 161 checkerColor = kTileCheckerboardColor; |
| 162 | 162 |
| 163 appendQuadsData.hadMissingTiles |= quadSink.append(Checkerbo
ardDrawQuad::create(sharedQuadState, tileRect, checkerColor).PassAs<DrawQuad>(),
appendQuadsData); | 163 appendQuadsData.hadMissingTiles |= quadSink.append(Checkerbo
ardDrawQuad::create(sharedQuadState, tileRect, checkerColor).PassAs<DrawQuad>(),
appendQuadsData); |
| 164 } else | 164 } else |
| 165 appendQuadsData.hadMissingTiles |= quadSink.append(SolidColo
rDrawQuad::create(sharedQuadState, tileRect, backgroundColor()).PassAs<DrawQuad>
(), appendQuadsData); | 165 appendQuadsData.hadMissingTiles |= quadSink.append(SolidColo
rDrawQuad::create(sharedQuadState, tileRect, backgroundColor()).PassAs<DrawQuad>
(), appendQuadsData); |
| 166 continue; | 166 continue; |
| 167 } | 167 } |
| 168 | 168 |
| 169 gfx::Rect tileOpaqueRect = tile->opaqueRect(); | 169 gfx::Rect tileOpaqueRect = contentsOpaque() ? tileRect : gfx::Inters
ectRects(tile->opaqueRect(), contentRect); |
| 170 tileOpaqueRect.Intersect(contentRect); | |
| 171 | 170 |
| 172 // Keep track of how the top left has moved, so the texture can be | 171 // Keep track of how the top left has moved, so the texture can be |
| 173 // offset the same amount. | 172 // offset the same amount. |
| 174 gfx::Vector2d displayOffset = tileRect.origin() - displayRect.origin
(); | 173 gfx::Vector2d displayOffset = tileRect.origin() - displayRect.origin
(); |
| 175 gfx::Vector2d textureOffset = m_tiler->textureOffset(i, j) + display
Offset; | 174 gfx::Vector2d textureOffset = m_tiler->textureOffset(i, j) + display
Offset; |
| 176 float tileWidth = static_cast<float>(m_tiler->tileSize().width()); | 175 float tileWidth = static_cast<float>(m_tiler->tileSize().width()); |
| 177 float tileHeight = static_cast<float>(m_tiler->tileSize().height()); | 176 float tileHeight = static_cast<float>(m_tiler->tileSize().height()); |
| 178 gfx::Size textureSize(tileWidth, tileHeight); | 177 gfx::Size textureSize(tileWidth, tileHeight); |
| 179 | 178 |
| 180 bool clipped = false; | 179 bool clipped = false; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 { | 233 { |
| 235 m_tiler->reset(); | 234 m_tiler->reset(); |
| 236 } | 235 } |
| 237 | 236 |
| 238 const char* TiledLayerImpl::layerTypeAsString() const | 237 const char* TiledLayerImpl::layerTypeAsString() const |
| 239 { | 238 { |
| 240 return "ContentLayer"; | 239 return "ContentLayer"; |
| 241 } | 240 } |
| 242 | 241 |
| 243 } // namespace cc | 242 } // namespace cc |
| OLD | NEW |