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

Side by Side Diff: ui/native_theme/native_theme_mac.mm

Issue 2661353002: ui/gfx: split out code that depends on paint (Closed)
Patch Set: Fix mac, chromeos build 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/gfx/skia_util.cc ('k') | ui/views/animation/ink_drop_painted_layer_delegates.cc » ('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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/native_theme_mac.h" 5 #include "ui/native_theme/native_theme_mac.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
11 #include "base/mac/scoped_cftyperef.h" 11 #include "base/mac/scoped_cftyperef.h"
12 #include "base/mac/sdk_forward_declarations.h" 12 #include "base/mac/sdk_forward_declarations.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #import "skia/ext/skia_utils_mac.h" 14 #import "skia/ext/skia_utils_mac.h"
15 #include "third_party/skia/include/core/SkDrawLooper.h" 15 #include "third_party/skia/include/core/SkDrawLooper.h"
16 #include "third_party/skia/include/core/SkRRect.h" 16 #include "third_party/skia/include/core/SkRRect.h"
17 #include "third_party/skia/include/effects/SkGradientShader.h" 17 #include "third_party/skia/include/effects/SkGradientShader.h"
18 #include "ui/base/material_design/material_design_controller.h" 18 #include "ui/base/material_design/material_design_controller.h"
19 #include "ui/gfx/color_palette.h" 19 #include "ui/gfx/color_palette.h"
20 #include "ui/gfx/geometry/rect.h" 20 #include "ui/gfx/geometry/rect.h"
21 #include "ui/gfx/shadow_value.h" 21 #include "ui/gfx/shadow_value.h"
22 #include "ui/gfx/skia_paint_util.h"
22 #include "ui/gfx/skia_util.h" 23 #include "ui/gfx/skia_util.h"
23 #include "ui/native_theme/common_theme.h" 24 #include "ui/native_theme/common_theme.h"
24 25
25 namespace { 26 namespace {
26 27
27 // Values calculated by reading pixels and solving simultaneous equations 28 // Values calculated by reading pixels and solving simultaneous equations
28 // derived from "A over B" alpha compositing. Steps: Sample the semi-transparent 29 // derived from "A over B" alpha compositing. Steps: Sample the semi-transparent
29 // pixel over two backgrounds; P1, P2 over backgrounds B1, B2. Use the color 30 // pixel over two backgrounds; P1, P2 over backgrounds B1, B2. Use the color
30 // value between 0.0 and 1.0 (i.e. divide by 255.0). Then, 31 // value between 0.0 and 1.0 (i.e. divide by 255.0). Then,
31 // alpha = (P2 - P1 + B1 - B2) / (B1 - B2) 32 // alpha = (P2 - P1 + B1 - B2) / (B1 - B2)
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 canvas->drawDRRect(outer_shape, shape, paint); 435 canvas->drawDRRect(outer_shape, shape, paint);
435 } 436 }
436 437
437 NativeThemeMac::NativeThemeMac() { 438 NativeThemeMac::NativeThemeMac() {
438 } 439 }
439 440
440 NativeThemeMac::~NativeThemeMac() { 441 NativeThemeMac::~NativeThemeMac() {
441 } 442 }
442 443
443 } // namespace ui 444 } // namespace ui
OLDNEW
« no previous file with comments | « ui/gfx/skia_util.cc ('k') | ui/views/animation/ink_drop_painted_layer_delegates.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698