| 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 "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "cc/debug_border_draw_quad.h" | 8 #include "cc/debug_border_draw_quad.h" |
| 9 #include "cc/render_pass_draw_quad.h" | 9 #include "cc/render_pass_draw_quad.h" |
| 10 #include "cc/solid_color_draw_quad.h" | 10 #include "cc/solid_color_draw_quad.h" |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 | 288 |
| 289 SkMatrix contentMat; | 289 SkMatrix contentMat; |
| 290 contentMat.setRectToRect(contentRect, destRect, SkMatrix::kFill_ScaleToFit); | 290 contentMat.setRectToRect(contentRect, destRect, SkMatrix::kFill_ScaleToFit); |
| 291 | 291 |
| 292 SkAutoTUnref<SkShader> shader(SkShader::CreateBitmapShader(*content, | 292 SkAutoTUnref<SkShader> shader(SkShader::CreateBitmapShader(*content, |
| 293 SkShader::kClamp_
TileMode, | 293 SkShader::kClamp_
TileMode, |
| 294 SkShader::kClamp_
TileMode)); | 294 SkShader::kClamp_
TileMode)); |
| 295 shader->setLocalMatrix(contentMat); | 295 shader->setLocalMatrix(contentMat); |
| 296 m_skCurrentPaint.setShader(shader); | 296 m_skCurrentPaint.setShader(shader); |
| 297 | 297 |
| 298 SkImageFilter* filter = renderPass->filter; | 298 SkImageFilter* filter = renderPass->filter.get(); |
| 299 if (filter) | 299 if (filter) |
| 300 m_skCurrentPaint.setImageFilter(filter); | 300 m_skCurrentPaint.setImageFilter(filter); |
| 301 | 301 |
| 302 if (quad->mask_resource_id) { | 302 if (quad->mask_resource_id) { |
| 303 ResourceProvider::ScopedReadLockSoftware maskLock(m_resourceProvider, qu
ad->mask_resource_id); | 303 ResourceProvider::ScopedReadLockSoftware maskLock(m_resourceProvider, qu
ad->mask_resource_id); |
| 304 | 304 |
| 305 const SkBitmap* mask = maskLock.skBitmap(); | 305 const SkBitmap* mask = maskLock.skBitmap(); |
| 306 | 306 |
| 307 SkRect maskRect = SkRect::MakeXYWH( | 307 SkRect maskRect = SkRect::MakeXYWH( |
| 308 quad->mask_tex_coord_offset_x * mask->width(), | 308 quad->mask_tex_coord_offset_x * mask->width(), |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 } | 358 } |
| 359 | 359 |
| 360 void SoftwareRenderer::setVisible(bool visible) | 360 void SoftwareRenderer::setVisible(bool visible) |
| 361 { | 361 { |
| 362 if (m_visible == visible) | 362 if (m_visible == visible) |
| 363 return; | 363 return; |
| 364 m_visible = visible; | 364 m_visible = visible; |
| 365 } | 365 } |
| 366 | 366 |
| 367 } // namespace cc | 367 } // namespace cc |
| OLD | NEW |