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

Unified Diff: chrome/browser/thumbnails/content_analysis_unittest.cc

Issue 2799213003: Remove deprecated functions from Canvas in favor of the RectF version. (Closed)
Patch Set: Remove deprecated functions from Canvas in favor of the RectF version 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 | « no previous file | ui/gfx/canvas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/thumbnails/content_analysis_unittest.cc
diff --git a/chrome/browser/thumbnails/content_analysis_unittest.cc b/chrome/browser/thumbnails/content_analysis_unittest.cc
index 6d44d14587926f3478cea4df98642276532a9024..547c51a45a7516e5cff9bd73e6c476592bcb8b20 100644
--- a/chrome/browser/thumbnails/content_analysis_unittest.cc
+++ b/chrome/browser/thumbnails/content_analysis_unittest.cc
@@ -24,6 +24,7 @@
#include "ui/gfx/color_analysis.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/geometry/rect.h"
+#include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/image/image.h"
@@ -127,7 +128,7 @@ TEST_F(ThumbnailContentAnalysisTest, ApplyGradientMagnitudeOnFrame) {
gfx::Canvas canvas(gfx::Size(800, 600), 1.0f, true);
// The image consists of a single white block in the centre.
- gfx::Rect draw_rect(300, 200, 200, 200);
+ gfx::RectF draw_rect(300, 200, 200, 200);
canvas.FillRect(gfx::Rect(0, 0, 800, 600), SkColorSetRGB(0, 0, 0));
canvas.DrawRect(draw_rect, SkColorSetRGB(255, 255, 255));
@@ -164,7 +165,7 @@ TEST_F(ThumbnailContentAnalysisTest, ExtractImageProfileInformation) {
gfx::Canvas canvas(gfx::Size(800, 600), 1.0f, true);
// The image consists of a white frame drawn in the centre.
- gfx::Rect draw_rect(100, 100, 200, 100);
+ gfx::RectF draw_rect(100, 100, 200, 100);
gfx::Rect image_rect(0, 0, 800, 600);
canvas.FillRect(image_rect, SkColorSetRGB(0, 0, 0));
canvas.DrawRect(draw_rect, SkColorSetRGB(255, 255, 255));
@@ -229,8 +230,8 @@ TEST_F(ThumbnailContentAnalysisTest,
// single-pixel vertical gap in between.
gfx::Rect image_rect(0, 0, 800, 600);
canvas.FillRect(image_rect, SkColorSetRGB(0, 0, 0));
- canvas.DrawRect(gfx::Rect(300, 250, 99, 100), SkColorSetRGB(255, 255, 255));
- canvas.DrawRect(gfx::Rect(401, 250, 99, 100), SkColorSetRGB(255, 255, 255));
+ canvas.DrawRect(gfx::RectF(300, 250, 99, 100), SkColorSetRGB(255, 255, 255));
+ canvas.DrawRect(gfx::RectF(401, 250, 99, 100), SkColorSetRGB(255, 255, 255));
SkBitmap source = canvas.GetBitmap();
SkBitmap reduced_color;
@@ -621,7 +622,7 @@ TEST_F(ThumbnailContentAnalysisTest, CreateRetargetedThumbnailImage) {
for (int x = footer_rect.x() + fine_print;
x < footer_rect.right() - fine_print;
x += 2 * fine_print) {
- canvas.DrawRect(gfx::Rect(x, y, fine_print, fine_print), print_color);
+ canvas.DrawRect(gfx::RectF(x, y, fine_print, fine_print), print_color);
}
}
@@ -649,7 +650,7 @@ TEST_F(ThumbnailContentAnalysisTest, CreateRetargetedThumbnailImage) {
for (int x = body_rect.x() + fine_print;
x < body_rect.right() - fine_print;
x += 2 * fine_print) {
- canvas.DrawRect(gfx::Rect(x, y, fine_print, fine_print), print_color);
+ canvas.DrawRect(gfx::RectF(x, y, fine_print, fine_print), print_color);
}
}
@@ -659,11 +660,10 @@ TEST_F(ThumbnailContentAnalysisTest, CreateRetargetedThumbnailImage) {
body_rect.height() / 3 * line + margin_vertical;
const int x = body_rect.x() +
alignment * body_rect.width() / 2 + margin_vertical;
- gfx::Rect pict_rect(x, y,
- body_rect.width() / 2 - 2 * margin_vertical,
+ gfx::Rect pict_rect(x, y, body_rect.width() / 2 - 2 * margin_vertical,
body_rect.height() / 3 - 2 * margin_vertical);
canvas.FillRect(pict_rect, SkColorSetRGB(255, 255, 255));
- canvas.DrawRect(pict_rect, SkColorSetRGB(0, 0, 0));
+ canvas.DrawRect(gfx::RectF(pict_rect), SkColorSetRGB(0, 0, 0));
}
SkBitmap source = canvas.GetBitmap();
« no previous file with comments | « no previous file | ui/gfx/canvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698