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

Unified Diff: ui/gfx/color_analysis_unittest.cc

Issue 2682123003: Remove uses of skia::ReadPixels(PaintCanvas) (Closed)
Patch Set: more readpixels Created 3 years, 10 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 | « ui/gfx/canvas.cc ('k') | ui/gfx/color_utils_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/color_analysis_unittest.cc
diff --git a/ui/gfx/color_analysis_unittest.cc b/ui/gfx/color_analysis_unittest.cc
index 821c3eae09dadcb05fe120bd7ba8f1a300437a75..4b6a465105786b983d943e68624ad49e47fbbbc2 100644
--- a/ui/gfx/color_analysis_unittest.cc
+++ b/ui/gfx/color_analysis_unittest.cc
@@ -345,8 +345,7 @@ TEST_F(ColorAnalysisTest, ComputeColorCovarianceWithCanvas) {
canvas.FillRect(gfx::Rect(150, 0, 50, 200), SkColorSetRGB(0, 100, 100));
canvas.FillRect(gfx::Rect(200, 0, 50, 200), SkColorSetRGB(0, 0, 100));
- SkBitmap bitmap = skia::ReadPixels(canvas.sk_canvas());
- gfx::Matrix3F covariance = ComputeColorCovariance(bitmap);
+ gfx::Matrix3F covariance = ComputeColorCovariance(canvas.ToBitmap());
gfx::Matrix3F expected_covariance = gfx::Matrix3F::Zeros();
expected_covariance.set(2400, 400, -1600,
@@ -403,7 +402,7 @@ TEST_F(ColorAnalysisTest, ApplyColorReductionBlackAndWhite) {
// The image consists of vertical non-overlapping stripes 150 pixels wide.
canvas.FillRect(gfx::Rect(0, 0, 150, 200), SkColorSetRGB(0, 0, 0));
canvas.FillRect(gfx::Rect(150, 0, 150, 200), SkColorSetRGB(255, 255, 255));
- SkBitmap source = skia::ReadPixels(canvas.sk_canvas());
+ SkBitmap source = canvas.ToBitmap();
SkBitmap result;
result.allocPixels(SkImageInfo::MakeA8(300, 200));
@@ -440,7 +439,7 @@ TEST_F(ColorAnalysisTest, ApplyColorReductionMultiColor) {
canvas.FillRect(gfx::Rect(0, 0, 100, 200), SkColorSetRGB(100, 0, 0));
canvas.FillRect(gfx::Rect(100, 0, 100, 200), SkColorSetRGB(0, 255, 0));
canvas.FillRect(gfx::Rect(200, 0, 100, 200), SkColorSetRGB(0, 0, 128));
- SkBitmap source = skia::ReadPixels(canvas.sk_canvas());
+ SkBitmap source = canvas.ToBitmap();
SkBitmap result;
result.allocPixels(SkImageInfo::MakeA8(300, 200));
@@ -482,7 +481,7 @@ TEST_F(ColorAnalysisTest, ComputePrincipalComponentImage) {
canvas.FillRect(gfx::Rect(0, 0, 100, 200), SkColorSetRGB(10, 10, 10));
canvas.FillRect(gfx::Rect(100, 0, 100, 200), SkColorSetRGB(100, 100, 100));
canvas.FillRect(gfx::Rect(200, 0, 100, 200), SkColorSetRGB(255, 255, 255));
- SkBitmap source = skia::ReadPixels(canvas.sk_canvas());
+ SkBitmap source = canvas.ToBitmap();
SkBitmap result;
result.allocPixels(SkImageInfo::MakeA8(300, 200));
« no previous file with comments | « ui/gfx/canvas.cc ('k') | ui/gfx/color_utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698