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

Unified Diff: ui/native_theme/native_theme_aura.cc

Issue 2523673004: [NOT FOR COMMIT] Fully replace SkCanvas uses.
Patch Set: Support Android build. Created 4 years 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/native_theme/native_theme_aura.h ('k') | ui/native_theme/native_theme_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/native_theme/native_theme_aura.cc
diff --git a/ui/native_theme/native_theme_aura.cc b/ui/native_theme/native_theme_aura.cc
index 1d67f96215de85480619e42fc3b87eb88d5ad851..e5778357b8584351485ed8c46b59d465bab81632 100644
--- a/ui/native_theme/native_theme_aura.cc
+++ b/ui/native_theme/native_theme_aura.cc
@@ -10,6 +10,7 @@
#include "base/logging.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
+#include "skia/ext/cdl_paint.h"
#include "ui/base/layout.h"
#include "ui/base/material_design/material_design_controller.h"
#include "ui/gfx/animation/tween.h"
@@ -98,14 +99,14 @@ SkColor NativeThemeAura::GetSystemColor(ColorId color_id) const {
}
void NativeThemeAura::PaintMenuPopupBackground(
- SkCanvas* canvas,
+ CdlCanvas* canvas,
const gfx::Size& size,
const MenuBackgroundExtraParams& menu_background) const {
SkColor color = GetSystemColor(NativeTheme::kColorId_MenuBackgroundColor);
if (menu_background.corner_radius > 0) {
- SkPaint paint;
- paint.setStyle(SkPaint::kFill_Style);
- paint.setFlags(SkPaint::kAntiAlias_Flag);
+ CdlPaint paint;
+ paint.setStyle(CdlPaint::kFill_Style);
+ paint.setAntiAlias(true);
paint.setColor(color);
gfx::Path path;
@@ -123,14 +124,14 @@ void NativeThemeAura::PaintMenuPopupBackground(
}
void NativeThemeAura::PaintMenuItemBackground(
- SkCanvas* canvas,
+ CdlCanvas* canvas,
State state,
const gfx::Rect& rect,
const MenuItemExtraParams& menu_item) const {
CommonThemePaintMenuItemBackground(this, canvas, state, rect, menu_item);
}
-void NativeThemeAura::PaintArrowButton(SkCanvas* canvas,
+void NativeThemeAura::PaintArrowButton(CdlCanvas* canvas,
const gfx::Rect& rect,
Part direction,
State state) const {
@@ -156,7 +157,7 @@ void NativeThemeAura::PaintArrowButton(SkCanvas* canvas,
}
DCHECK_NE(arrow_color, gfx::kPlaceholderColor);
- SkPaint paint;
+ CdlPaint paint;
paint.setColor(bg_color);
canvas->drawIRect(gfx::RectToSkIRect(rect), paint);
@@ -164,20 +165,20 @@ void NativeThemeAura::PaintArrowButton(SkCanvas* canvas,
}
void NativeThemeAura::PaintScrollbarTrack(
- SkCanvas* canvas,
+ CdlCanvas* canvas,
Part part,
State state,
const ScrollbarTrackExtraParams& extra_params,
const gfx::Rect& rect) const {
// Overlay Scrollbar should never paint a scrollbar track.
DCHECK(!use_overlay_scrollbars_);
- SkPaint paint;
+ CdlPaint paint;
paint.setColor(kTrackColor);
canvas->drawIRect(gfx::RectToSkIRect(rect), paint);
}
void NativeThemeAura::PaintScrollbarThumb(
- SkCanvas* canvas,
+ CdlCanvas* canvas,
Part part,
State state,
const gfx::Rect& rect,
@@ -215,10 +216,10 @@ void NativeThemeAura::PaintScrollbarThumb(
// In overlay mode, draw a stroke (border).
constexpr int kStrokeWidth = kOverlayScrollbarStrokeWidth;
- SkPaint paint;
+ CdlPaint paint;
paint.setColor(
SkColorSetA(kOverlayScrollbarStrokeColor[theme], thumb_alpha));
- paint.setStyle(SkPaint::kStroke_Style);
+ paint.setStyle(CdlPaint::kStroke_Style);
paint.setStrokeWidth(kStrokeWidth);
gfx::RectF stroke_rect(thumb_rect);
@@ -242,17 +243,17 @@ void NativeThemeAura::PaintScrollbarThumb(
thumb_color = SK_ColorBLACK;
}
- SkPaint paint;
+ CdlPaint paint;
paint.setColor(SkColorSetA(thumb_color, thumb_alpha));
canvas->drawIRect(gfx::RectToSkIRect(thumb_rect), paint);
}
-void NativeThemeAura::PaintScrollbarCorner(SkCanvas* canvas,
+void NativeThemeAura::PaintScrollbarCorner(CdlCanvas* canvas,
State state,
const gfx::Rect& rect) const {
// Overlay Scrollbar should never paint a scrollbar corner.
DCHECK(!use_overlay_scrollbars_);
- SkPaint paint;
+ CdlPaint paint;
paint.setColor(SkColorSetRGB(0xDC, 0xDC, 0xDC));
canvas->drawIRect(RectToSkIRect(rect), paint);
}
« no previous file with comments | « ui/native_theme/native_theme_aura.h ('k') | ui/native_theme/native_theme_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698