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

Unified Diff: remoting/base/util.cc

Issue 7992011: Move us fully from gfx:: over to skia types for consistency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix for bad DEPS Created 9 years, 3 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/base/util.h ('k') | remoting/client/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/util.cc
diff --git a/remoting/base/util.cc b/remoting/base/util.cc
index 483d97fae0861e86e051546172f173a998c2b295..e960f09fbd21dc0867afaf9e76a09b919f0e8110 100644
--- a/remoting/base/util.cc
+++ b/remoting/base/util.cc
@@ -54,13 +54,13 @@ void ConvertYUVToRGB32WithRect(const uint8* y_plane,
const uint8* u_plane,
const uint8* v_plane,
uint8* rgb_plane,
- const gfx::Rect& rect,
+ const SkIRect& rect,
int y_stride,
int uv_stride,
int rgb_stride) {
- int rgb_offset = CalculateRGBOffset(rect.x(), rect.y(), rgb_stride);
- int y_offset = CalculateYOffset(rect.x(), rect.y(), y_stride);
- int uv_offset = CalculateUVOffset(rect.x(), rect.y(), uv_stride);
+ int rgb_offset = CalculateRGBOffset(rect.fLeft, rect.fTop, rgb_stride);
+ int y_offset = CalculateYOffset(rect.fLeft, rect.fTop, y_stride);
+ int uv_offset = CalculateUVOffset(rect.fLeft, rect.fTop, uv_stride);
media::ConvertYUVToRGB32(y_plane + y_offset,
u_plane + uv_offset,
@@ -78,15 +78,20 @@ void ScaleYUVToRGB32WithRect(const uint8* y_plane,
const uint8* u_plane,
const uint8* v_plane,
uint8* rgb_plane,
- const gfx::Rect& source_rect,
- const gfx::Rect& dest_rect,
+ const SkIRect& source_rect,
+ const SkIRect& dest_rect,
int y_stride,
int uv_stride,
int rgb_stride) {
- int rgb_offset = CalculateRGBOffset(dest_rect.x(), dest_rect.y(), rgb_stride);
- int y_offset = CalculateYOffset(source_rect.x(), source_rect.y(), y_stride);
- int uv_offset = CalculateUVOffset(source_rect.x(),
- source_rect.y(), uv_stride);
+ int rgb_offset = CalculateRGBOffset(dest_rect.fLeft,
+ dest_rect.fTop,
+ rgb_stride);
+ int y_offset = CalculateYOffset(source_rect.fLeft,
+ source_rect.fTop,
+ y_stride);
+ int uv_offset = CalculateUVOffset(source_rect.fLeft,
+ source_rect.fTop,
+ uv_stride);
media::ScaleYUVToRGB32(y_plane + y_offset,
u_plane + uv_offset,
@@ -134,26 +139,23 @@ int RoundToTwosMultiple(int x) {
return x & (~1);
}
-gfx::Rect AlignRect(const gfx::Rect& rect) {
- int x = RoundToTwosMultiple(rect.x());
- int y = RoundToTwosMultiple(rect.y());
- int right = RoundToTwosMultiple(rect.right() + 1);
- int bottom = RoundToTwosMultiple(rect.bottom() + 1);
- return gfx::Rect(x, y, right - x, bottom - y);
+SkIRect AlignRect(const SkIRect& rect) {
+ int x = RoundToTwosMultiple(rect.fLeft);
+ int y = RoundToTwosMultiple(rect.fTop);
+ int right = RoundToTwosMultiple(rect.fRight + 1);
+ int bottom = RoundToTwosMultiple(rect.fBottom + 1);
+ return SkIRect::MakeXYWH(x, y, right - x, bottom - y);
}
-gfx::Rect ScaleRect(const gfx::Rect& rect,
- double horizontal_ratio,
- double vertical_ratio) {
- gfx::Rect scaled_rect(rect.x() * horizontal_ratio,
- rect.y() * vertical_ratio,
- 0,
- 0);
- scaled_rect.set_width(
- rect.right() * horizontal_ratio - scaled_rect.x());
- scaled_rect.set_height(
- rect.bottom() * vertical_ratio - scaled_rect.y());
- return scaled_rect;
+SkIRect ScaleRect(const SkIRect& rect,
+ double horizontal_ratio,
+ double vertical_ratio) {
+ int x = rect.fLeft * horizontal_ratio;
+ int y = rect.fTop * vertical_ratio;
+ int w = rect.fRight * horizontal_ratio - x;
+ int h = rect.fBottom * vertical_ratio - y;
+
+ return SkIRect::MakeXYWH(x, y, w, h);
}
void CopyRect(const uint8* src_plane,
« no previous file with comments | « remoting/base/util.h ('k') | remoting/client/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698