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

Unified Diff: chromecast/media/base/video_plane_controller.cc

Issue 1972433002: [Chromecast] Handle device scale factor correctly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test compile error Created 4 years, 7 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 | « chromecast/media/base/video_plane_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/media/base/video_plane_controller.cc
diff --git a/chromecast/media/base/video_plane_controller.cc b/chromecast/media/base/video_plane_controller.cc
index 00b45e5a62673358154040ca53bb7105b334c0f3..2c0864ec6610dfeafccb05577a0d6f799376423b 100644
--- a/chromecast/media/base/video_plane_controller.cc
+++ b/chromecast/media/base/video_plane_controller.cc
@@ -140,12 +140,12 @@ class VideoPlaneController::RateLimitedSetVideoPlaneGeometry
};
VideoPlaneController::VideoPlaneController(
+ const Size& graphics_resolution,
scoped_refptr<base::SingleThreadTaskRunner> media_task_runner)
: is_paused_(false),
have_screen_res_(false),
- have_graphics_plane_res_(false),
screen_res_(0, 0),
- graphics_plane_res_(0, 0),
+ graphics_plane_res_(graphics_resolution),
have_video_plane_geometry_(false),
video_plane_display_rect_(0, 0),
video_plane_transform_(VideoPlane::TRANSFORM_NONE),
@@ -195,27 +195,6 @@ void VideoPlaneController::SetScreenResolution(const Size& resolution) {
MaybeRunSetGeometry();
}
-void VideoPlaneController::SetGraphicsPlaneResolution(const Size& resolution) {
- DCHECK(thread_checker_.CalledOnValidThread());
- DCHECK(ResolutionSizeValid(resolution));
- if (have_graphics_plane_res_ && SizeEqual(resolution, graphics_plane_res_)) {
- VLOG(2) << "No change found in graphics plane resolution.";
- return;
- }
-
- VLOG(1) << "New graphics plane resolution " << resolution.width << "x"
- << resolution.height;
-
- have_graphics_plane_res_ = true;
- graphics_plane_res_ = resolution;
-
- // Any cached video plane geometry parameters are no longer valid since they
- // were relative to the PREVIOUS graphics plane resolution. Thus, the cached
- // parameters are cleared, and it's the caller's responsibility to call
- // SetGeometry() with arguments relative to the NEW graphics plane if needed.
- ClearVideoPlaneGeometry();
-}
-
void VideoPlaneController::Pause() {
DCHECK(thread_checker_.CalledOnValidThread());
VLOG(1) << "Pausing controller. No more VideoPlane SetGeometry calls.";
@@ -267,8 +246,7 @@ void VideoPlaneController::MaybeRunSetGeometry() {
}
bool VideoPlaneController::HaveDataForSetGeometry() const {
- return have_screen_res_ && have_graphics_plane_res_ &&
- have_video_plane_geometry_;
+ return have_screen_res_ && have_video_plane_geometry_;
}
void VideoPlaneController::ClearVideoPlaneGeometry() {
« no previous file with comments | « chromecast/media/base/video_plane_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698