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

Unified Diff: skia/ext/image_operations_unittest.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
« no previous file with comments | « skia/ext/image_operations.cc ('k') | skia/ext/platform_canvas_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/image_operations_unittest.cc
diff --git a/skia/ext/image_operations_unittest.cc b/skia/ext/image_operations_unittest.cc
index e88c5e28f290d1aaea0313b4b148f09f70ead2d8..a05dfeda9ab002d971b12b4d3bf4397e3b3e5381 100644
--- a/skia/ext/image_operations_unittest.cc
+++ b/skia/ext/image_operations_unittest.cc
@@ -162,7 +162,6 @@ void DrawCheckerToBitmap(int w, int h,
#if DEBUG_BITMAP_GENERATION
void SaveBitmapToPNG(const SkBitmap& bmp, const char* path) {
- SkAutoLockPixels lock(bmp);
std::vector<unsigned char> png;
gfx::PNGCodec::ColorFormat color_format = gfx::PNGCodec::FORMAT_RGBA;
if (!gfx::PNGCodec::Encode(
@@ -195,8 +194,6 @@ void CheckResampleToSame(skia::ImageOperations::ResizeMethod method) {
ASSERT_EQ(src_w, results.width());
ASSERT_EQ(src_h, results.height());
- SkAutoLockPixels src_lock(src);
- SkAutoLockPixels results_lock(results);
for (int y = 0; y < src_h; y++) {
for (int x = 0; x < src_w; x++) {
EXPECT_EQ(*src.getAddr32(x, y), *results.getAddr32(x, y));
@@ -261,8 +258,6 @@ void CheckResizeMethodShouldAverageGrid(
float max_observed_distance = 0.0f;
bool all_pixels_ok = true;
- SkAutoLockPixels dest_lock(dest);
-
for (size_t pixel_index = 0;
pixel_index < arraysize(tested_pixels);
++pixel_index) {
@@ -367,7 +362,6 @@ TEST(ImageOperations, Halve) {
ASSERT_EQ(src_h / 2, actual_results.height());
// Compute the expected values & compare.
- SkAutoLockPixels lock(actual_results);
for (int y = 0; y < actual_results.height(); y++) {
for (int x = 0; x < actual_results.width(); x++) {
// Note that those expressions take into account the "half-pixel"
@@ -421,8 +415,6 @@ TEST(ImageOperations, HalveSubset) {
// The computed subset and the corresponding subset of the original image
// should be the same.
- SkAutoLockPixels full_lock(full_results);
- SkAutoLockPixels subset_lock(subset_results);
for (int y = 0; y < subset_rect.height(); y++) {
for (int x = 0; x < subset_rect.width(); x++) {
ASSERT_EQ(
@@ -543,7 +535,6 @@ TEST(ImageOperations, ScaleUp) {
src,
skia::ImageOperations::RESIZE_LANCZOS3,
dst_w, dst_h);
- SkAutoLockPixels dst_lock(dst);
for (int dst_y = 0; dst_y < dst_h; ++dst_y) {
for (int dst_x = 0; dst_x < dst_w; ++dst_x) {
float dst_x_in_src = (dst_x + 0.5) * src_w / dst_w;
« no previous file with comments | « skia/ext/image_operations.cc ('k') | skia/ext/platform_canvas_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698