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

Side by Side Diff: ui/native_theme/common_theme.cc

Issue 2640983002: Rename paint data structures (Closed)
Patch Set: DrawingDisplayItem Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « ui/native_theme/common_theme.h ('k') | ui/native_theme/native_theme.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/native_theme/common_theme.h" 5 #include "ui/native_theme/common_theme.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "third_party/skia/include/core/SkCanvas.h" 9 #include "third_party/skia/include/core/SkCanvas.h"
10 #include "ui/base/material_design/material_design_controller.h" 10 #include "ui/base/material_design/material_design_controller.h"
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 case NativeTheme::kColorId_NumColors: 333 case NativeTheme::kColorId_NumColors:
334 break; 334 break;
335 } 335 }
336 336
337 NOTREACHED(); 337 NOTREACHED();
338 return gfx::kPlaceholderColor; 338 return gfx::kPlaceholderColor;
339 } 339 }
340 340
341 void CommonThemePaintMenuItemBackground( 341 void CommonThemePaintMenuItemBackground(
342 const NativeTheme* theme, 342 const NativeTheme* theme,
343 SkCanvas* canvas, 343 cc::PaintCanvas* canvas,
344 NativeTheme::State state, 344 NativeTheme::State state,
345 const gfx::Rect& rect, 345 const gfx::Rect& rect,
346 const NativeTheme::MenuItemExtraParams& menu_item) { 346 const NativeTheme::MenuItemExtraParams& menu_item) {
347 SkPaint paint; 347 cc::PaintFlags paint;
348 switch (state) { 348 switch (state) {
349 case NativeTheme::kNormal: 349 case NativeTheme::kNormal:
350 case NativeTheme::kDisabled: 350 case NativeTheme::kDisabled:
351 paint.setColor( 351 paint.setColor(
352 theme->GetSystemColor(NativeTheme::kColorId_MenuBackgroundColor)); 352 theme->GetSystemColor(NativeTheme::kColorId_MenuBackgroundColor));
353 break; 353 break;
354 case NativeTheme::kHovered: 354 case NativeTheme::kHovered:
355 paint.setColor(theme->GetSystemColor( 355 paint.setColor(theme->GetSystemColor(
356 NativeTheme::kColorId_FocusedMenuItemBackgroundColor)); 356 NativeTheme::kColorId_FocusedMenuItemBackgroundColor));
357 break; 357 break;
358 default: 358 default:
359 NOTREACHED() << "Invalid state " << state; 359 NOTREACHED() << "Invalid state " << state;
360 break; 360 break;
361 } 361 }
362 if (menu_item.corner_radius > 0) { 362 if (menu_item.corner_radius > 0) {
363 const SkScalar radius = SkIntToScalar(menu_item.corner_radius); 363 const SkScalar radius = SkIntToScalar(menu_item.corner_radius);
364 canvas->drawRoundRect(gfx::RectToSkRect(rect), radius, radius, paint); 364 canvas->drawRoundRect(gfx::RectToSkRect(rect), radius, radius, paint);
365 return; 365 return;
366 } 366 }
367 canvas->drawRect(gfx::RectToSkRect(rect), paint); 367 canvas->drawRect(gfx::RectToSkRect(rect), paint);
368 } 368 }
369 369
370 } // namespace ui 370 } // namespace ui
OLDNEW
« no previous file with comments | « ui/native_theme/common_theme.h ('k') | ui/native_theme/native_theme.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698