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

Unified Diff: ui/views/painter.cc

Issue 2640983002: Rename paint data structures (Closed)
Patch Set: DrawingDisplayItem Created 3 years, 11 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/views/controls/table/table_view.cc ('k') | ui/views/round_rect_painter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/painter.cc
diff --git a/ui/views/painter.cc b/ui/views/painter.cc
index c64a0d71af91500d15b1350e7a26b40c3c893541..e6384dbffa9e8b7931c71f11bee3d1329b729dfb 100644
--- a/ui/views/painter.cc
+++ b/ui/views/painter.cc
@@ -9,6 +9,7 @@
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
+#include "cc/paint/paint_shader.h"
#include "third_party/skia/include/effects/SkGradientShader.h"
#include "third_party/skia/include/pathops/SkPathOps.h"
#include "ui/base/resource/resource_bundle.h"
@@ -69,14 +70,14 @@ void SolidRoundRectPainter::Paint(gfx::Canvas* canvas, const gfx::Size& size) {
gfx::RectF border_rect_f(gfx::ScaleToEnclosingRect(gfx::Rect(size), scale));
const SkScalar scaled_corner_radius = SkFloatToScalar(radius_ * scale);
- SkPaint paint;
+ cc::PaintFlags paint;
paint.setAntiAlias(true);
- paint.setStyle(SkPaint::kFill_Style);
+ paint.setStyle(cc::PaintFlags::kFill_Style);
paint.setColor(bg_color_);
canvas->DrawRoundRect(border_rect_f, scaled_corner_radius, paint);
border_rect_f.Inset(gfx::InsetsF(0.5f));
- paint.setStyle(SkPaint::kStroke_Style);
+ paint.setStyle(cc::PaintFlags::kStroke_Style);
paint.setStrokeWidth(1);
paint.setColor(stroke_color_);
canvas->DrawRoundRect(border_rect_f, scaled_corner_radius, paint);
@@ -204,7 +205,7 @@ gfx::Size GradientPainter::GetMinimumSize() const {
}
void GradientPainter::Paint(gfx::Canvas* canvas, const gfx::Size& size) {
- SkPaint paint;
+ cc::PaintFlags paint;
SkPoint p[2];
p[0].iset(0, 0);
if (horizontal_)
@@ -212,9 +213,9 @@ void GradientPainter::Paint(gfx::Canvas* canvas, const gfx::Size& size) {
else
p[1].iset(0, size.height());
- paint.setShader(SkGradientShader::MakeLinear(
- p, colors_.get(), pos_.get(), count_, SkShader::kClamp_TileMode));
- paint.setStyle(SkPaint::kFill_Style);
+ paint.setShader(cc::WrapSkShader(SkGradientShader::MakeLinear(
+ p, colors_.get(), pos_.get(), count_, SkShader::kClamp_TileMode)));
+ paint.setStyle(cc::PaintFlags::kFill_Style);
canvas->sk_canvas()->drawRectCoords(SkIntToScalar(0), SkIntToScalar(0),
SkIntToScalar(size.width()),
« no previous file with comments | « ui/views/controls/table/table_view.cc ('k') | ui/views/round_rect_painter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698