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

Side by Side Diff: cc/raster/raster_source_unittest.cc

Issue 2781183002: Remove image_decode_tasks_enabled flag. (Closed)
Patch Set: fixes Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « cc/layers/recording_source_unittest.cc ('k') | cc/test/fake_recording_source.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/raster/raster_source.h" 5 #include "cc/raster/raster_source.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 // Discardable pixel refs are found in the following cells: 200 // Discardable pixel refs are found in the following cells:
201 // |---|---| 201 // |---|---|
202 // | x | x | 202 // | x | x |
203 // |---|---| 203 // |---|---|
204 // | | x | 204 // | | x |
205 // |---|---| 205 // |---|---|
206 recording_source->add_draw_image(discardable_image[0][0], gfx::Point(0, 0)); 206 recording_source->add_draw_image(discardable_image[0][0], gfx::Point(0, 0));
207 recording_source->add_draw_image(discardable_image[0][1], gfx::Point(260, 0)); 207 recording_source->add_draw_image(discardable_image[0][1], gfx::Point(260, 0));
208 recording_source->add_draw_image(discardable_image[1][1], 208 recording_source->add_draw_image(discardable_image[1][1],
209 gfx::Point(260, 260)); 209 gfx::Point(260, 260));
210 recording_source->SetGenerateDiscardableImagesMetadata(true);
211 recording_source->Rerecord(); 210 recording_source->Rerecord();
212 211
213 scoped_refptr<RasterSource> raster = 212 scoped_refptr<RasterSource> raster =
214 RasterSource::CreateFromRecordingSource(recording_source.get(), false); 213 RasterSource::CreateFromRecordingSource(recording_source.get(), false);
215 214
216 // Tile sized iterators. These should find only one pixel ref. 215 // Tile sized iterators. These should find only one pixel ref.
217 { 216 {
218 gfx::ColorSpace target_color_space = gfx::ColorSpace::CreateSRGB(); 217 gfx::ColorSpace target_color_space = gfx::ColorSpace::CreateSRGB();
219 std::vector<DrawImage> images; 218 std::vector<DrawImage> images;
220 raster->GetDiscardableImagesInRect(gfx::Rect(0, 0, 256, 256), 1.f, 219 raster->GetDiscardableImagesInRect(gfx::Rect(0, 0, 256, 256), 1.f,
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 // 3. Draw 4x4 green rects into every corner. 585 // 3. Draw 4x4 green rects into every corner.
587 flags.setColor(SK_ColorGREEN); 586 flags.setColor(SK_ColorGREEN);
588 recording_source->add_draw_rect_with_flags(gfx::Rect(0, 0, 4, 4), flags); 587 recording_source->add_draw_rect_with_flags(gfx::Rect(0, 0, 4, 4), flags);
589 recording_source->add_draw_rect_with_flags( 588 recording_source->add_draw_rect_with_flags(
590 gfx::Rect(size.width() - 4, 0, 4, 4), flags); 589 gfx::Rect(size.width() - 4, 0, 4, 4), flags);
591 recording_source->add_draw_rect_with_flags( 590 recording_source->add_draw_rect_with_flags(
592 gfx::Rect(0, size.height() - 4, 4, 4), flags); 591 gfx::Rect(0, size.height() - 4, 4, 4), flags);
593 recording_source->add_draw_rect_with_flags( 592 recording_source->add_draw_rect_with_flags(
594 gfx::Rect(size.width() - 4, size.height() - 4, 4, 4), flags); 593 gfx::Rect(size.width() - 4, size.height() - 4, 4, 4), flags);
595 594
596 recording_source->SetGenerateDiscardableImagesMetadata(true);
597 recording_source->Rerecord(); 595 recording_source->Rerecord();
598 596
599 bool can_use_lcd = true; 597 bool can_use_lcd = true;
600 scoped_refptr<RasterSource> raster_source = 598 scoped_refptr<RasterSource> raster_source =
601 recording_source->CreateRasterSource(can_use_lcd); 599 recording_source->CreateRasterSource(can_use_lcd);
602 SoftwareImageDecodeCache controller( 600 SoftwareImageDecodeCache controller(
603 ResourceFormat::RGBA_8888, 601 ResourceFormat::RGBA_8888,
604 LayerTreeSettings().decoded_image_working_set_budget_bytes); 602 LayerTreeSettings().decoded_image_working_set_budget_bytes);
605 raster_source->set_image_decode_cache(&controller); 603 raster_source->set_image_decode_cache(&controller);
606 604
(...skipping 14 matching lines...) Expand all
621 EXPECT_EQ(SK_ColorGREEN, bitmap.getColor(0, 24)); 619 EXPECT_EQ(SK_ColorGREEN, bitmap.getColor(0, 24));
622 EXPECT_EQ(SK_ColorGREEN, bitmap.getColor(49, 24)); 620 EXPECT_EQ(SK_ColorGREEN, bitmap.getColor(49, 24));
623 for (int x = 0; x < 49; ++x) 621 for (int x = 0; x < 49; ++x)
624 EXPECT_EQ(SK_ColorRED, bitmap.getColor(x, 12)); 622 EXPECT_EQ(SK_ColorRED, bitmap.getColor(x, 12));
625 for (int y = 0; y < 24; ++y) 623 for (int y = 0; y < 24; ++y)
626 EXPECT_EQ(SK_ColorRED, bitmap.getColor(24, y)); 624 EXPECT_EQ(SK_ColorRED, bitmap.getColor(24, y));
627 } 625 }
628 626
629 } // namespace 627 } // namespace
630 } // namespace cc 628 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/recording_source_unittest.cc ('k') | cc/test/fake_recording_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698