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

Unified Diff: remoting/base/util.cc

Issue 11470028: Move screen capturers to remoting/capturer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/capturer/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 6e656bf4b1d08868578b5c747329ecec8f67f570..31dda25844b4095ceb11ac9d27b6c767d40b558f 100644
--- a/remoting/base/util.cc
+++ b/remoting/base/util.cc
@@ -214,29 +214,6 @@ SkIRect ScaleRect(const SkIRect& rect,
return SkIRect::MakeLTRB(left, top, right, bottom);
}
-void CopyRect(const uint8* src_plane,
- int src_plane_stride,
- uint8* dest_plane,
- int dest_plane_stride,
- int bytes_per_pixel,
- const SkIRect& rect) {
- // Get the address of the starting point.
- const int src_y_offset = src_plane_stride * rect.top();
- const int dest_y_offset = dest_plane_stride * rect.top();
- const int x_offset = bytes_per_pixel * rect.left();
- src_plane += src_y_offset + x_offset;
- dest_plane += dest_y_offset + x_offset;
-
- // Copy pixels in the rectangle line by line.
- const int bytes_per_line = bytes_per_pixel * rect.width();
- const int height = rect.height();
- for (int i = 0 ; i < height; ++i) {
- memcpy(dest_plane, src_plane, bytes_per_line);
- src_plane += src_plane_stride;
- dest_plane += dest_plane_stride;
- }
-}
-
void CopyRGB32Rect(const uint8* source_buffer,
int source_stride,
const SkIRect& source_buffer_rect,
@@ -248,20 +225,20 @@ void CopyRGB32Rect(const uint8* source_buffer,
DCHECK(source_buffer_rect.contains(dest_rect));
// Get the address of the starting point.
- int source_offset = CalculateRGBOffset(dest_rect.x() - source_buffer_rect.x(),
- dest_rect.y() - source_buffer_rect.y(),
- source_stride);
- int dest_offset = CalculateRGBOffset(dest_rect.x() - dest_buffer_rect.x(),
- dest_rect.y() - dest_buffer_rect.y(),
- source_stride);
-
- // Copy bits.
- CopyRect(source_buffer + source_offset,
- source_stride,
- dest_buffer + dest_offset,
- dest_stride,
- kBytesPerPixelRGB32,
- SkIRect::MakeWH(dest_rect.width(), dest_rect.height()));
+ source_buffer += CalculateRGBOffset(dest_rect.x() - source_buffer_rect.x(),
+ dest_rect.y() - source_buffer_rect.y(),
+ source_stride);
+ dest_buffer += CalculateRGBOffset(dest_rect.x() - dest_buffer_rect.x(),
+ dest_rect.y() - dest_buffer_rect.y(),
+ source_stride);
+
+ // Copy pixels in the rectangle line by line.
+ const int bytes_per_line = kBytesPerPixelRGB32 * dest_rect.width();
+ for (int i = 0 ; i < dest_rect.height(); ++i) {
+ memcpy(dest_buffer, source_buffer, bytes_per_line);
+ source_buffer += source_stride;
+ dest_buffer += dest_stride;
+ }
}
std::string ReplaceLfByCrLf(const std::string& in) {
« no previous file with comments | « remoting/base/util.h ('k') | remoting/capturer/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698