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

Unified Diff: remoting/test/frame_generator_util.cc

Issue 2823003002: SkBitmap and SkPixelRef no longer need lock/unlock (Closed)
Patch Set: win fix after rebase Created 3 years, 8 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
Index: remoting/test/frame_generator_util.cc
diff --git a/remoting/test/frame_generator_util.cc b/remoting/test/frame_generator_util.cc
index bef4040390f6956b541964e95cdf05f99a1d495a..f8231fa6f50dbda457b2d99cf94891dba8a36220 100644
--- a/remoting/test/frame_generator_util.cc
+++ b/remoting/test/frame_generator_util.cc
@@ -18,13 +18,11 @@ namespace {
void CopyPixelsToBuffer(const SkBitmap& src,
uint8_t* dst_pixels,
int dst_stride) {
- SkBitmap tmp(src);
- tmp.lockPixels();
- const char* src_pixels = static_cast<const char*>(tmp.getPixels());
- size_t src_stride = tmp.rowBytes();
+ const char* src_pixels = static_cast<const char*>(src.getPixels());
+ size_t src_stride = src.rowBytes();
// Only need to copy the important parts of the row.
- size_t bytes_per_row = tmp.width() * tmp.bytesPerPixel();
- for (int y = 0; y < tmp.height(); ++y) {
+ size_t bytes_per_row = src.width() * src.bytesPerPixel();
+ for (int y = 0; y < src.height(); ++y) {
memcpy(dst_pixels, src_pixels, bytes_per_row);
src_pixels += src_stride;
dst_pixels += dst_stride;

Powered by Google App Engine
This is Rietveld 408576698