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

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: 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
Index: cc/output/software_renderer.cc
diff --git a/cc/output/software_renderer.cc b/cc/output/software_renderer.cc
index ae58b63304a10172b73165c9f2849c5f2ad53833..32c5b13ac0030445eb3b264a20b6c75350f534ea 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::RectToSkRect(
+ gfx::ToNearestRect(gfx::ScaleRect(quad->mask_uv_rect(),
danakj 2014/10/15 15:33:35 the uv scale will always be an integer? and why no
enne (OOO) 2014/10/15 19:10:54 Sadly, it won't always be an integer. Previously,
danakj 2014/10/15 19:37:26 ToNearestRect will DCHECK if you're not "basically
enne (OOO) 2014/10/15 19:49:02 That's...awkward. I guess I'll ToEnclosedRect thi
+ quad->mask_texture_size.width(),
+ quad->mask_texture_size.height())));
SkMatrix mask_mat;
mask_mat.setRectToRect(mask_rect, dest_rect, SkMatrix::kFill_ScaleToFit);

Powered by Google App Engine
This is Rietveld 408576698