diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-15 23:58:33 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-15 23:58:33 +0000 |
commit | 5e9ca8a510914662f4795ac43fa0b35ef5e449d3 (patch) | |
tree | 8826e2c0f6113c738f344085b042ef16a5885b38 /remoting | |
parent | 2964d2080646dc87150c3abb140ccac800282958 (diff) | |
download | chromium_src-5e9ca8a510914662f4795ac43fa0b35ef5e449d3.zip chromium_src-5e9ca8a510914662f4795ac43fa0b35ef5e449d3.tar.gz chromium_src-5e9ca8a510914662f4795ac43fa0b35ef5e449d3.tar.bz2 |
remoting: Move CGRectToSkIRect() to the only file where it's called
The alternative would be to add SK_API to that function.
BUG=90078
TEST=none
Review URL: http://codereview.chromium.org/9705064
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127036 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r-- | remoting/host/capturer_mac.cc | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/remoting/host/capturer_mac.cc b/remoting/host/capturer_mac.cc index 394c8b1..42b362a 100644 --- a/remoting/host/capturer_mac.cc +++ b/remoting/host/capturer_mac.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -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); |