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

Unified Diff: ui/gfx/canvas_skia.cc

Issue 8681001: Revert 111288 - Possibly broke media_unittests on Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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_skia.h ('k') | ui/gfx/canvas_skia_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/canvas_skia.cc
===================================================================
--- ui/gfx/canvas_skia.cc (revision 111322)
+++ ui/gfx/canvas_skia.cc (working copy)
@@ -133,7 +133,7 @@
paint.setColor(color);
paint.setStyle(SkPaint::kFill_Style);
paint.setXfermodeMode(mode);
- DrawRect(rect, paint);
+ DrawRectInt(rect.x(), rect.y(), rect.width(), rect.height(), paint);
}
void CanvasSkia::FillRect(const gfx::Brush* brush, const gfx::Rect& rect) {
@@ -141,16 +141,16 @@
SkPaint paint;
paint.setShader(shader->shader());
// TODO(beng): set shader transform to match canvas transform.
- DrawRect(rect, paint);
+ DrawRectInt(rect.x(), rect.y(), rect.width(), rect.height(), paint);
}
-void CanvasSkia::DrawRect(const gfx::Rect& rect, const SkColor& color) {
- DrawRect(rect, color, SkXfermode::kSrcOver_Mode);
+void CanvasSkia::DrawRectInt(const SkColor& color, int x, int y, int w, int h) {
+ DrawRectInt(color, x, y, w, h, SkXfermode::kSrcOver_Mode);
}
-void CanvasSkia::DrawRect(const gfx::Rect& rect,
- const SkColor& color,
- SkXfermode::Mode mode) {
+void CanvasSkia::DrawRectInt(const SkColor& color,
+ int x, int y, int w, int h,
+ SkXfermode::Mode mode) {
SkPaint paint;
paint.setColor(color);
paint.setStyle(SkPaint::kStroke_Style);
@@ -160,11 +160,12 @@
paint.setStrokeWidth(SkIntToScalar(0));
paint.setXfermodeMode(mode);
- DrawRect(rect, paint);
+ DrawRectInt(x, y, w, h, paint);
}
-void CanvasSkia::DrawRect(const gfx::Rect& rect, const SkPaint& paint) {
- canvas_->drawIRect(RectToSkIRect(rect), paint);
+void CanvasSkia::DrawRectInt(int x, int y, int w, int h, const SkPaint& paint) {
+ SkIRect rc = { x, y, x + w, y + h };
+ canvas_->drawIRect(rc, paint);
}
void CanvasSkia::DrawLineInt(const SkColor& color,
@@ -213,12 +214,10 @@
paint.setShader(shader);
shader->unref();
- DrawRect(gfx::Rect(rect.x(), rect.y(), rect.width(), 1), paint);
- DrawRect(gfx::Rect(rect.x(), rect.y() + rect.height() - 1, rect.width(), 1),
- paint);
- DrawRect(gfx::Rect(rect.x(), rect.y(), 1, rect.height()), paint);
- DrawRect(gfx::Rect(rect.x() + rect.width() - 1, rect.y(), 1, rect.height()),
- paint);
+ DrawRectInt(rect.x(), rect.y(), rect.width(), 1, paint);
+ DrawRectInt(rect.x(), rect.y() + rect.height() - 1, rect.width(), 1, paint);
+ DrawRectInt(rect.x(), rect.y(), 1, rect.height(), paint);
+ DrawRectInt(rect.x() + rect.width() - 1, rect.y(), 1, rect.height(), paint);
}
void CanvasSkia::DrawBitmapInt(const SkBitmap& bitmap, int x, int y) {
« no previous file with comments | « ui/gfx/canvas_skia.h ('k') | ui/gfx/canvas_skia_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698