| 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/WebImage.h> | 7 #include <public/WebImage.h> |
| 8 | 8 |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "cc/debug_border_draw_quad.h" | 10 #include "cc/debug_border_draw_quad.h" |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 SkImageFilter* filter = renderPass->filter.get(); | 314 SkImageFilter* filter = renderPass->filter.get(); |
| 315 if (filter) | 315 if (filter) |
| 316 m_skCurrentPaint.setImageFilter(filter); | 316 m_skCurrentPaint.setImageFilter(filter); |
| 317 | 317 |
| 318 if (quad->mask_resource_id) { | 318 if (quad->mask_resource_id) { |
| 319 ResourceProvider::ScopedReadLockSoftware maskLock(m_resourceProvider, qu
ad->mask_resource_id); | 319 ResourceProvider::ScopedReadLockSoftware maskLock(m_resourceProvider, qu
ad->mask_resource_id); |
| 320 | 320 |
| 321 const SkBitmap* mask = maskLock.skBitmap(); | 321 const SkBitmap* mask = maskLock.skBitmap(); |
| 322 | 322 |
| 323 SkRect maskRect = SkRect::MakeXYWH( | 323 SkRect maskRect = SkRect::MakeXYWH( |
| 324 quad->mask_tex_coord_offset_x * mask->width(), | 324 quad->mask_uv_rect.x() * mask->width(), |
| 325 quad->mask_tex_coord_offset_y * mask->height(), | 325 quad->mask_uv_rect.y() * mask->height(), |
| 326 quad->mask_tex_coord_scale_x * mask->width(), | 326 quad->mask_uv_rect.width() * mask->width(), |
| 327 quad->mask_tex_coord_scale_y * mask->height()); | 327 quad->mask_uv_rect.height() * mask->height()); |
| 328 | 328 |
| 329 SkMatrix maskMat; | 329 SkMatrix maskMat; |
| 330 maskMat.setRectToRect(maskRect, destRect, SkMatrix::kFill_ScaleToFit); | 330 maskMat.setRectToRect(maskRect, destRect, SkMatrix::kFill_ScaleToFit); |
| 331 | 331 |
| 332 skia::RefPtr<SkShader> maskShader = skia::AdoptRef( | 332 skia::RefPtr<SkShader> maskShader = skia::AdoptRef( |
| 333 SkShader::CreateBitmapShader(*mask, | 333 SkShader::CreateBitmapShader(*mask, |
| 334 SkShader::kClamp_TileMode, | 334 SkShader::kClamp_TileMode, |
| 335 SkShader::kClamp_TileMode)); | 335 SkShader::kClamp_TileMode)); |
| 336 maskShader->setLocalMatrix(maskMat); | 336 maskShader->setLocalMatrix(maskMat); |
| 337 | 337 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 } | 375 } |
| 376 | 376 |
| 377 void SoftwareRenderer::setVisible(bool visible) | 377 void SoftwareRenderer::setVisible(bool visible) |
| 378 { | 378 { |
| 379 if (m_visible == visible) | 379 if (m_visible == visible) |
| 380 return; | 380 return; |
| 381 m_visible = visible; | 381 m_visible = visible; |
| 382 } | 382 } |
| 383 | 383 |
| 384 } // namespace cc | 384 } // namespace cc |
| OLD | NEW |