| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "CCRendererSoftware.h" | 7 #include "CCRendererSoftware.h" |
| 8 | 8 |
| 9 #include "CCDebugBorderDrawQuad.h" | 9 #include "CCDebugBorderDrawQuad.h" |
| 10 #include "CCSolidColorDrawQuad.h" | 10 #include "CCSolidColorDrawQuad.h" |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 FloatRect uvRect = quad->uvRect(); | 257 FloatRect uvRect = quad->uvRect(); |
| 258 uvRect.scale(quad->quadRect().width(), quad->quadRect().height()); | 258 uvRect.scale(quad->quadRect().width(), quad->quadRect().height()); |
| 259 SkIRect skUvRect = toSkIRect(enclosingIntRect(uvRect)); | 259 SkIRect skUvRect = toSkIRect(enclosingIntRect(uvRect)); |
| 260 if (quad->flipped()) | 260 if (quad->flipped()) |
| 261 m_skCurrentCanvas->scale(1, -1); | 261 m_skCurrentCanvas->scale(1, -1); |
| 262 m_skCurrentCanvas->drawBitmapRect(*quadResourceLock.skBitmap(), &skUvRect, t
oSkRect(quadVertexRect()), &m_skCurrentPaint); | 262 m_skCurrentCanvas->drawBitmapRect(*quadResourceLock.skBitmap(), &skUvRect, t
oSkRect(quadVertexRect()), &m_skCurrentPaint); |
| 263 } | 263 } |
| 264 | 264 |
| 265 void CCRendererSoftware::drawTileQuad(const DrawingFrame& frame, const CCTileDra
wQuad* quad) | 265 void CCRendererSoftware::drawTileQuad(const DrawingFrame& frame, const CCTileDra
wQuad* quad) |
| 266 { | 266 { |
| 267 ASSERT(isSoftwareResource(quad->resourceId())); | 267 DCHECK(isSoftwareResource(quad->resourceId())); |
| 268 CCResourceProvider::ScopedReadLockSoftware quadResourceLock(m_resourceProvid
er, quad->resourceId()); | 268 CCResourceProvider::ScopedReadLockSoftware quadResourceLock(m_resourceProvid
er, quad->resourceId()); |
| 269 | 269 |
| 270 SkIRect uvRect = toSkIRect(IntRect(quad->textureOffset(), quad->quadRect().s
ize())); | 270 SkIRect uvRect = toSkIRect(IntRect(quad->textureOffset(), quad->quadRect().s
ize())); |
| 271 m_skCurrentCanvas->drawBitmapRect(*quadResourceLock.skBitmap(), &uvRect, toS
kRect(quadVertexRect()), &m_skCurrentPaint); | 271 m_skCurrentCanvas->drawBitmapRect(*quadResourceLock.skBitmap(), &uvRect, toS
kRect(quadVertexRect()), &m_skCurrentPaint); |
| 272 } | 272 } |
| 273 | 273 |
| 274 void CCRendererSoftware::drawRenderPassQuad(const DrawingFrame& frame, const CCR
enderPassDrawQuad* quad) | 274 void CCRendererSoftware::drawRenderPassQuad(const DrawingFrame& frame, const CCR
enderPassDrawQuad* quad) |
| 275 { | 275 { |
| 276 CachedTexture* contentsTexture = m_renderPassTextures.get(quad->renderPassId
()); | 276 CachedTexture* contentsTexture = m_renderPassTextures.get(quad->renderPassId
()); |
| 277 if (!contentsTexture || !contentsTexture->id()) | 277 if (!contentsTexture || !contentsTexture->id()) |
| 278 return; | 278 return; |
| 279 | 279 |
| 280 ASSERT(isSoftwareResource(contentsTexture->id())); | 280 DCHECK(isSoftwareResource(contentsTexture->id())); |
| 281 CCResourceProvider::ScopedReadLockSoftware contentsTextureLock(m_resourcePro
vider, contentsTexture->id()); | 281 CCResourceProvider::ScopedReadLockSoftware contentsTextureLock(m_resourcePro
vider, contentsTexture->id()); |
| 282 | 282 |
| 283 const SkBitmap* bitmap = contentsTextureLock.skBitmap(); | 283 const SkBitmap* bitmap = contentsTextureLock.skBitmap(); |
| 284 | 284 |
| 285 SkRect sourceRect; | 285 SkRect sourceRect; |
| 286 bitmap->getBounds(&sourceRect); | 286 bitmap->getBounds(&sourceRect); |
| 287 | 287 |
| 288 SkRect destRect = toSkRect(quadVertexRect()); | 288 SkRect destRect = toSkRect(quadVertexRect()); |
| 289 | 289 |
| 290 SkMatrix matrix; | 290 SkMatrix matrix; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 } | 348 } |
| 349 | 349 |
| 350 void CCRendererSoftware::setVisible(bool visible) | 350 void CCRendererSoftware::setVisible(bool visible) |
| 351 { | 351 { |
| 352 if (m_visible == visible) | 352 if (m_visible == visible) |
| 353 return; | 353 return; |
| 354 m_visible = visible; | 354 m_visible = visible; |
| 355 } | 355 } |
| 356 | 356 |
| 357 } | 357 } |
| OLD | NEW |