Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3731)

Unified Diff: cc/output/software_renderer.cc

Issue 659683002: Include mask texture size in RenderPassDrawQuad (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@update_mask_draw_quad_test
Patch Set: No ToEnclosedRect Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/output/renderer_pixeltest.cc ('k') | cc/quads/draw_quad_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/software_renderer.cc
diff --git a/cc/output/software_renderer.cc b/cc/output/software_renderer.cc
index ae58b63304a10172b73165c9f2849c5f2ad53833..c3cb828c62bc7d1961aaca445f6283d3f0dfced3 100644
--- a/cc/output/software_renderer.cc
+++ b/cc/output/software_renderer.cc
@@ -518,11 +518,11 @@ void SoftwareRenderer::DrawRenderPassQuad(const DrawingFrame* frame,
const SkBitmap* mask = mask_lock.sk_bitmap();
- SkRect mask_rect = SkRect::MakeXYWH(
- quad->mask_uv_rect.x() * mask->width(),
- quad->mask_uv_rect.y() * mask->height(),
- quad->mask_uv_rect.width() * mask->width(),
- quad->mask_uv_rect.height() * mask->height());
+ // Scale normalized uv rect into absolute texel coordinates.
+ SkRect mask_rect =
+ gfx::RectFToSkRect(gfx::ScaleRect(quad->MaskUVRect(),
+ quad->mask_texture_size.width(),
+ quad->mask_texture_size.height()));
SkMatrix mask_mat;
mask_mat.setRectToRect(mask_rect, dest_rect, SkMatrix::kFill_ScaleToFit);
« no previous file with comments | « cc/output/renderer_pixeltest.cc ('k') | cc/quads/draw_quad_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698