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

Unified Diff: cc/output/renderer_pixeltest.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 | « cc/output/gl_renderer.cc ('k') | cc/resources/ui_resource_bitmap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/renderer_pixeltest.cc
diff --git a/cc/output/renderer_pixeltest.cc b/cc/output/renderer_pixeltest.cc
index f54ab1d69090d459d686406b26d5cbe2199a6d87..7a9851ea32578b3776f4e4d63edc84e1b7bb40e8 100644
--- a/cc/output/renderer_pixeltest.cc
+++ b/cc/output/renderer_pixeltest.cc
@@ -1986,12 +1986,10 @@ TYPED_TEST(RendererPixelTest, RenderPassAndMaskWithPartialQuad) {
ResourceId mask_resource_id = this->resource_provider_->CreateResource(
mask_rect.size(), ResourceProvider::TEXTURE_HINT_IMMUTABLE, RGBA_8888,
gfx::ColorSpace());
- {
- SkAutoLockPixels lock(bitmap);
- this->resource_provider_->CopyToResource(
- mask_resource_id, reinterpret_cast<uint8_t*>(bitmap.getPixels()),
- mask_rect.size());
- }
+
+ this->resource_provider_->CopyToResource(
+ mask_resource_id, reinterpret_cast<uint8_t*>(bitmap.getPixels()),
+ mask_rect.size());
// This RenderPassDrawQuad does not include the full |viewport_rect| which is
// the size of the child render pass.
@@ -2081,12 +2079,10 @@ TYPED_TEST(RendererPixelTest, RenderPassAndMaskWithPartialQuad2) {
ResourceId mask_resource_id = this->resource_provider_->CreateResource(
mask_rect.size(), ResourceProvider::TEXTURE_HINT_IMMUTABLE, RGBA_8888,
gfx::ColorSpace());
- {
- SkAutoLockPixels lock(bitmap);
- this->resource_provider_->CopyToResource(
- mask_resource_id, reinterpret_cast<uint8_t*>(bitmap.getPixels()),
- mask_rect.size());
- }
+
+ this->resource_provider_->CopyToResource(
+ mask_resource_id, reinterpret_cast<uint8_t*>(bitmap.getPixels()),
+ mask_rect.size());
// This RenderPassDrawQuad does not include the full |viewport_rect| which is
// the size of the child render pass.
@@ -2809,25 +2805,19 @@ TYPED_TEST(RendererPixelTest, TileDrawQuadNearestNeighbor) {
SkBitmap bitmap;
bitmap.allocN32Pixels(2, 2);
- {
- SkAutoLockPixels lock(bitmap);
- SkCanvas canvas(bitmap);
- draw_point_color(&canvas, 0, 0, SK_ColorGREEN);
- draw_point_color(&canvas, 0, 1, SK_ColorBLUE);
- draw_point_color(&canvas, 1, 0, SK_ColorBLUE);
- draw_point_color(&canvas, 1, 1, SK_ColorGREEN);
- }
+ SkCanvas canvas(bitmap);
+ draw_point_color(&canvas, 0, 0, SK_ColorGREEN);
+ draw_point_color(&canvas, 0, 1, SK_ColorBLUE);
+ draw_point_color(&canvas, 1, 0, SK_ColorBLUE);
+ draw_point_color(&canvas, 1, 1, SK_ColorGREEN);
gfx::Size tile_size(2, 2);
ResourceId resource = this->resource_provider_->CreateResource(
tile_size, ResourceProvider::TEXTURE_HINT_IMMUTABLE, RGBA_8888,
gfx::ColorSpace());
- {
- SkAutoLockPixels lock(bitmap);
- this->resource_provider_->CopyToResource(
- resource, static_cast<uint8_t*>(bitmap.getPixels()), tile_size);
- }
+ this->resource_provider_->CopyToResource(
+ resource, static_cast<uint8_t*>(bitmap.getPixels()), tile_size);
int id = 1;
gfx::Transform transform_to_root;
@@ -2860,25 +2850,19 @@ TYPED_TEST(SoftwareRendererPixelTest, TextureDrawQuadNearestNeighbor) {
SkBitmap bitmap;
bitmap.allocN32Pixels(2, 2);
- {
- SkAutoLockPixels lock(bitmap);
- SkCanvas canvas(bitmap);
- draw_point_color(&canvas, 0, 0, SK_ColorGREEN);
- draw_point_color(&canvas, 0, 1, SK_ColorBLUE);
- draw_point_color(&canvas, 1, 0, SK_ColorBLUE);
- draw_point_color(&canvas, 1, 1, SK_ColorGREEN);
- }
+ SkCanvas canvas(bitmap);
+ draw_point_color(&canvas, 0, 0, SK_ColorGREEN);
+ draw_point_color(&canvas, 0, 1, SK_ColorBLUE);
+ draw_point_color(&canvas, 1, 0, SK_ColorBLUE);
+ draw_point_color(&canvas, 1, 1, SK_ColorGREEN);
gfx::Size tile_size(2, 2);
ResourceId resource = this->resource_provider_->CreateResource(
tile_size, ResourceProvider::TEXTURE_HINT_IMMUTABLE, RGBA_8888,
gfx::ColorSpace());
- {
- SkAutoLockPixels lock(bitmap);
- this->resource_provider_->CopyToResource(
- resource, static_cast<uint8_t*>(bitmap.getPixels()), tile_size);
- }
+ this->resource_provider_->CopyToResource(
+ resource, static_cast<uint8_t*>(bitmap.getPixels()), tile_size);
int id = 1;
gfx::Transform transform_to_root;
@@ -2913,7 +2897,6 @@ TYPED_TEST(SoftwareRendererPixelTest, TextureDrawQuadLinear) {
SkBitmap bitmap;
bitmap.allocN32Pixels(2, 2);
{
- SkAutoLockPixels lock(bitmap);
SkCanvas canvas(bitmap);
draw_point_color(&canvas, 0, 0, SK_ColorGREEN);
draw_point_color(&canvas, 0, 1, SK_ColorBLUE);
@@ -2926,11 +2909,8 @@ TYPED_TEST(SoftwareRendererPixelTest, TextureDrawQuadLinear) {
tile_size, ResourceProvider::TEXTURE_HINT_IMMUTABLE, RGBA_8888,
gfx::ColorSpace());
- {
- SkAutoLockPixels lock(bitmap);
- this->resource_provider_->CopyToResource(
- resource, static_cast<uint8_t*>(bitmap.getPixels()), tile_size);
- }
+ this->resource_provider_->CopyToResource(
+ resource, static_cast<uint8_t*>(bitmap.getPixels()), tile_size);
int id = 1;
gfx::Transform transform_to_root;
@@ -3289,12 +3269,10 @@ TEST_F(GLRendererPixelTest, TextureQuadBatching) {
ResourceId resource = this->resource_provider_->CreateResource(
mask_rect.size(), ResourceProvider::TEXTURE_HINT_IMMUTABLE, RGBA_8888,
gfx::ColorSpace());
- {
- SkAutoLockPixels lock(bitmap);
- this->resource_provider_->CopyToResource(
- resource, reinterpret_cast<uint8_t*>(bitmap.getPixels()),
- mask_rect.size());
- }
+
+ this->resource_provider_->CopyToResource(
+ resource, reinterpret_cast<uint8_t*>(bitmap.getPixels()),
+ mask_rect.size());
// Arbitrary dividing lengths to divide up the resource into 16 quads.
int widths[] = {
« no previous file with comments | « cc/output/gl_renderer.cc ('k') | cc/resources/ui_resource_bitmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698