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

Unified Diff: remoting/host/capturer_mac.cc

Issue 9705064: remoting: Move CGRectToSkIRect() to the only file where it's called (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 9 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 | skia/ext/skia_utils_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/capturer_mac.cc
diff --git a/remoting/host/capturer_mac.cc b/remoting/host/capturer_mac.cc
index 394c8b1b4a0d524198089de79431412ea18a9469..23930bed3abc7d4e07c919aacf5b491df0516f30 100644
--- a/remoting/host/capturer_mac.cc
+++ b/remoting/host/capturer_mac.cc
@@ -17,13 +17,22 @@
#include "base/synchronization/waitable_event.h"
#include "remoting/base/util.h"
#include "remoting/host/capturer_helper.h"
-#include "skia/ext/skia_utils_mac.h"
namespace remoting {
namespace {
+SkIRect CGRectToSkIRect(const CGRect& rect) {
+ SkIRect sk_rect = {
+ SkScalarRound(rect.origin.x),
+ SkScalarRound(rect.origin.y),
+ SkScalarRound(rect.origin.x + rect.size.width),
+ SkScalarRound(rect.origin.y + rect.size.height)
+ };
+ return sk_rect;
+}
+
#if (MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5)
// Possibly remove CapturerMac::CgBlitPreLion as well depending on performance
// of CapturerMac::CgBlitPostLion on 10.6.
@@ -555,7 +564,7 @@ const SkISize& CapturerMac::size_most_recent() const {
void CapturerMac::ScreenRefresh(CGRectCount count, const CGRect *rect_array) {
SkIRect skirect_array[count];
for (CGRectCount i = 0; i < count; ++i) {
- skirect_array[i] = gfx::CGRectToSkIRect(rect_array[i]);
+ skirect_array[i] = CGRectToSkIRect(rect_array[i]);
}
SkRegion region;
region.setRects(skirect_array, count);
@@ -569,7 +578,7 @@ void CapturerMac::ScreenUpdateMove(CGScreenUpdateMoveDelta delta,
for (CGRectCount i = 0; i < count; ++i) {
CGRect rect = rect_array[i];
rect = CGRectOffset(rect, delta.dX, delta.dY);
- skirect_new_array[i] = gfx::CGRectToSkIRect(rect);
+ skirect_new_array[i] = CGRectToSkIRect(rect);
}
SkRegion region;
region.setRects(skirect_new_array, count);
« no previous file with comments | « no previous file | skia/ext/skia_utils_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698