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

Unified Diff: media/renderers/skcanvas_video_renderer.cc

Issue 1369563002: Compare the full rect in SkCanvasVideoRenderer::Paint for transform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sizemedia: rebase Created 5 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 | « no previous file | ui/gfx/skia_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/renderers/skcanvas_video_renderer.cc
diff --git a/media/renderers/skcanvas_video_renderer.cc b/media/renderers/skcanvas_video_renderer.cc
index 7863a0d02e849dd37f966291df238755fdca696a..a382445bad6eb24f52eb768066ef13d5f8ca98db 100644
--- a/media/renderers/skcanvas_video_renderer.cc
+++ b/media/renderers/skcanvas_video_renderer.cc
@@ -20,6 +20,7 @@
#include "third_party/skia/include/gpu/GrTextureProvider.h"
#include "third_party/skia/include/gpu/SkGr.h"
#include "ui/gfx/geometry/rect_f.h"
+#include "ui/gfx/skia_util.h"
// Skia internal format depends on a platform. On Android it is ABGR, on others
// it is ARGB.
@@ -350,10 +351,12 @@ void SkCanvasVideoRenderer::Paint(const scoped_refptr<VideoFrame>& video_frame,
paint.setXfermodeMode(mode);
paint.setFilterQuality(kLow_SkFilterQuality);
- const bool need_transform =
- video_rotation != VIDEO_ROTATION_0 ||
- dest_rect.size() != gfx::SizeF(video_frame->visible_rect().size()) ||
- !dest_rect.origin().IsOrigin();
+ const bool need_rotation = video_rotation != VIDEO_ROTATION_0;
+ const bool need_scaling =
+ dest_rect.size() !=
+ gfx::SizeF(gfx::SkISizeToSize(last_image_->dimensions()));
+ const bool need_translation = !dest_rect.origin().IsOrigin();
+ bool need_transform = need_rotation || need_scaling || need_translation;
if (need_transform) {
canvas->save();
canvas->translate(
« no previous file with comments | « no previous file | ui/gfx/skia_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698