| 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 "cc/software_renderer.h" | 5 #include "cc/software_renderer.h" |
| 6 | 6 |
| 7 #include <public/WebCompositorSoftwareOutputDevice.h> | 7 #include <public/WebCompositorSoftwareOutputDevice.h> |
| 8 #include <public/WebImage.h> | 8 #include <public/WebImage.h> |
| 9 #include <public/WebSize.h> | 9 #include <public/WebSize.h> |
| 10 | 10 |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 | 306 |
| 307 SkMatrix contentMat; | 307 SkMatrix contentMat; |
| 308 contentMat.setRectToRect(contentRect, destRect, SkMatrix::kFill_ScaleToFit); | 308 contentMat.setRectToRect(contentRect, destRect, SkMatrix::kFill_ScaleToFit); |
| 309 | 309 |
| 310 SkAutoTUnref<SkShader> shader(SkShader::CreateBitmapShader(*content, | 310 SkAutoTUnref<SkShader> shader(SkShader::CreateBitmapShader(*content, |
| 311 SkShader::kClamp_
TileMode, | 311 SkShader::kClamp_
TileMode, |
| 312 SkShader::kClamp_
TileMode)); | 312 SkShader::kClamp_
TileMode)); |
| 313 shader->setLocalMatrix(contentMat); | 313 shader->setLocalMatrix(contentMat); |
| 314 m_skCurrentPaint.setShader(shader); | 314 m_skCurrentPaint.setShader(shader); |
| 315 | 315 |
| 316 SkImageFilter* filter = renderPass->filter; | 316 SkImageFilter* filter = renderPass->filter.get(); |
| 317 if (filter) | 317 if (filter) |
| 318 m_skCurrentPaint.setImageFilter(filter); | 318 m_skCurrentPaint.setImageFilter(filter); |
| 319 | 319 |
| 320 if (quad->mask_resource_id) { | 320 if (quad->mask_resource_id) { |
| 321 ResourceProvider::ScopedReadLockSoftware maskLock(m_resourceProvider, qu
ad->mask_resource_id); | 321 ResourceProvider::ScopedReadLockSoftware maskLock(m_resourceProvider, qu
ad->mask_resource_id); |
| 322 | 322 |
| 323 const SkBitmap* mask = maskLock.skBitmap(); | 323 const SkBitmap* mask = maskLock.skBitmap(); |
| 324 | 324 |
| 325 SkRect maskRect = SkRect::MakeXYWH( | 325 SkRect maskRect = SkRect::MakeXYWH( |
| 326 quad->mask_tex_coord_offset_x * mask->width(), | 326 quad->mask_tex_coord_offset_x * mask->width(), |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 } | 376 } |
| 377 | 377 |
| 378 void SoftwareRenderer::setVisible(bool visible) | 378 void SoftwareRenderer::setVisible(bool visible) |
| 379 { | 379 { |
| 380 if (m_visible == visible) | 380 if (m_visible == visible) |
| 381 return; | 381 return; |
| 382 m_visible = visible; | 382 m_visible = visible; |
| 383 } | 383 } |
| 384 | 384 |
| 385 } // namespace cc | 385 } // namespace cc |
| OLD | NEW |