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

Unified Diff: ui/views/controls/button/label_button_border.cc

Issue 1610573004: Replace use of SkLerpXfermode with SkArithmeticMode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « 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/controls/button/label_button_border.cc
diff --git a/ui/views/controls/button/label_button_border.cc b/ui/views/controls/button/label_button_border.cc
index ab7140821bf6eaea6684df6cff66330fa52850c4..c93215e2dc4ae1b064db2e392c29e8cf2f3ad4bf 100644
--- a/ui/views/controls/button/label_button_border.cc
+++ b/ui/views/controls/button/label_button_border.cc
@@ -6,7 +6,7 @@
#include "base/logging.h"
#include "third_party/skia/include/core/SkPaint.h"
-#include "third_party/skia/include/effects/SkLerpXfermode.h"
+#include "third_party/skia/include/effects/SkArithmeticMode.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/animation/animation.h"
#include "ui/gfx/canvas.h"
@@ -148,9 +148,10 @@ void LabelButtonAssetBorder::Paint(const View& view, gfx::Canvas* canvas) {
PaintHelper(this, canvas, state, rect, extra);
SkPaint paint;
- skia::RefPtr<SkXfermode> sk_lerp_xfer =
- skia::AdoptRef(SkLerpXfermode::Create(animation->GetCurrentValue()));
- paint.setXfermode(sk_lerp_xfer.get());
+ double scale = animation->GetCurrentValue();
+ skia::RefPtr<SkXfermode> sk_arith_xfer =
+ skia::AdoptRef(SkArithmeticMode::Create(0.0f, scale, 1.0 - scale, 0.0));
+ paint.setXfermode(sk_arith_xfer.get());
canvas->sk_canvas()->saveLayer(&sk_rect, &paint);
state = native_theme_delegate->GetForegroundThemeState(&extra);
PaintHelper(this, canvas, state, rect, extra);
« 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