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

Unified Diff: ui/views/animation/ink_drop_painted_layer_delegates.cc

Issue 2349273002: Avoid kStrokeAndFill_Style in BorderShadowLayerDelegate::OnPaintLayer (Closed)
Patch Set: Created 4 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/animation/ink_drop_painted_layer_delegates.cc
diff --git a/ui/views/animation/ink_drop_painted_layer_delegates.cc b/ui/views/animation/ink_drop_painted_layer_delegates.cc
index 0ca68999ba97367906cd546d028abd390a136aa5..6eb553435999ac81bc9687bff87b23493f53d1be 100644
--- a/ui/views/animation/ink_drop_painted_layer_delegates.cc
+++ b/ui/views/animation/ink_drop_painted_layer_delegates.cc
@@ -6,7 +6,6 @@
#include "third_party/skia/include/core/SkDrawLooper.h"
#include "third_party/skia/include/core/SkPaint.h"
-#include "third_party/skia/include/core/SkPath.h"
#include "ui/compositor/paint_recorder.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_palette.h"
@@ -154,24 +153,21 @@ gfx::Vector2dF BorderShadowLayerDelegate::GetCenteringOffset() const {
void BorderShadowLayerDelegate::OnPaintLayer(const ui::PaintContext& context) {
SkPaint paint;
paint.setLooper(gfx::CreateShadowDrawLooperCorrectBlur(shadows_));
- paint.setStyle(SkPaint::kStrokeAndFill_Style);
+ paint.setStyle(SkPaint::kFill_Style);
paint.setAntiAlias(true);
paint.setColor(SK_ColorTRANSPARENT);
- paint.setStrokeJoin(SkPaint::kRound_Join);
- SkRect path_bounds = gfx::RectFToSkRect(
- gfx::RectF(bounds_ - GetPaintedBounds().OffsetFromOrigin()));
+ gfx::RectF rrect_bounds =
+ gfx::RectF(bounds_ - GetPaintedBounds().OffsetFromOrigin());
ui::PaintRecorder recorder(context, GetPaintedBounds().size());
- const SkScalar corner = SkFloatToScalar(corner_radius_);
- SkPath path;
- path.addRoundRect(path_bounds, corner, corner, SkPath::kCCW_Direction);
- recorder.canvas()->DrawPath(path, paint);
+ recorder.canvas()->DrawRoundRect(rrect_bounds, corner_radius_, paint);
SkPaint clear_paint;
clear_paint.setAntiAlias(true);
clear_paint.setXfermodeMode(SkXfermode::kClear_Mode);
- recorder.canvas()->sk_canvas()->drawRoundRect(path_bounds, corner, corner,
- clear_paint);
+ // If we don't care about actually clearing preexisting buffer content,
+ // this could be replaced with a kDifference clip for the draw above.
+ recorder.canvas()->DrawRoundRect(rrect_bounds, corner_radius_, clear_paint);
}
} // namespace views
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698