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

Unified Diff: remoting/host/screen_resolution.cc

Issue 13983010: Use webrtc::DesktopCapturer for screen capturer implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | « remoting/host/screen_resolution.h ('k') | remoting/host/screen_resolution_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/screen_resolution.cc
diff --git a/remoting/host/screen_resolution.cc b/remoting/host/screen_resolution.cc
index a8a7e682155d4cd44e6dedbc860d0c87f0cd72fa..b792cefc582be87d2f83c017bfbf00843bb1e9af 100644
--- a/remoting/host/screen_resolution.cc
+++ b/remoting/host/screen_resolution.cc
@@ -7,20 +7,27 @@
#include <algorithm>
#include <limits>
+#include "base/logging.h"
+
namespace remoting {
ScreenResolution::ScreenResolution()
- : dimensions_(SkISize::Make(0, 0)),
- dpi_(SkIPoint::Make(0, 0)) {
+ : dimensions_(webrtc::DesktopSize(0, 0)),
+ dpi_(webrtc::DesktopVector(0, 0)) {
}
-ScreenResolution::ScreenResolution(const SkISize& dimensions,
- const SkIPoint& dpi)
+ScreenResolution::ScreenResolution(const webrtc::DesktopSize& dimensions,
+ const webrtc::DesktopVector& dpi)
: dimensions_(dimensions),
dpi_(dpi) {
+ // Check that dimensions are not negative.
+ DCHECK(!dimensions.is_empty() || dimensions.equals(webrtc::DesktopSize()));
+ DCHECK_GE(dpi.x(), 0);
+ DCHECK_GE(dpi.y(), 0);
}
-SkISize ScreenResolution::ScaleDimensionsToDpi(const SkIPoint& new_dpi) const {
+webrtc::DesktopSize ScreenResolution::ScaleDimensionsToDpi(
+ const webrtc::DesktopVector& new_dpi) const {
int64 width = dimensions_.width();
int64 height = dimensions_.height();
@@ -29,15 +36,11 @@ SkISize ScreenResolution::ScaleDimensionsToDpi(const SkIPoint& new_dpi) const {
static_cast<int64>(std::numeric_limits<int32>::max()));
height = std::min(height * new_dpi.y() / dpi_.y(),
static_cast<int64>(std::numeric_limits<int32>::max()));
- return SkISize::Make(static_cast<int32>(width), static_cast<int32>(height));
+ return webrtc::DesktopSize(width, height);
}
bool ScreenResolution::IsEmpty() const {
- return dimensions_.isEmpty() || dpi_.x() <= 0 || dpi_.y() <= 0;
-}
-
-bool ScreenResolution::IsValid() const {
- return !IsEmpty() || dimensions_.isZero();
+ return dimensions_.is_empty() || dpi_.is_zero();
}
} // namespace remoting
« no previous file with comments | « remoting/host/screen_resolution.h ('k') | remoting/host/screen_resolution_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698