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

Side by Side Diff: sky/engine/core/painting/TransferMode.cpp

Issue 1162393002: Simplify TransferMode and Color types. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: format Created 5 years, 6 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 | « sky/engine/core/painting/TransferMode.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "sky/engine/config.h" 5 #include "sky/engine/config.h"
6 #include "sky/engine/core/painting/TransferMode.h" 6 #include "sky/engine/core/painting/TransferMode.h"
7 7
8 #include "sky/engine/core/script/dom_dart_state.h" 8 #include "sky/engine/core/script/dom_dart_state.h"
9 #include "sky/engine/tonic/dart_builtin.h" 9 #include "sky/engine/tonic/dart_builtin.h"
10 #include "sky/engine/tonic/dart_error.h" 10 #include "sky/engine/tonic/dart_error.h"
11 #include "sky/engine/tonic/dart_value.h" 11 #include "sky/engine/tonic/dart_value.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 // Convert dart_mode => SkXfermode::Mode. 15 // Convert dart_mode => SkXfermode::Mode.
16 TransferMode DartConverter<TransferMode, void>::FromArgumentsWithNullCheck( 16 SkXfermode::Mode DartConverter<TransferMode>::FromArgumentsWithNullCheck(
17 Dart_NativeArguments args, 17 Dart_NativeArguments args,
18 int index, 18 int index,
19 Dart_Handle& exception) { 19 Dart_Handle& exception) {
20 TransferMode result; 20 SkXfermode::Mode result;
21 21
22 Dart_Handle dart_mode = Dart_GetNativeArgument(args, index); 22 Dart_Handle dart_mode = Dart_GetNativeArgument(args, index);
23 DCHECK(!LogIfError(dart_mode)); 23 DCHECK(!LogIfError(dart_mode));
24 24
25 Dart_Handle value = 25 Dart_Handle value =
26 Dart_GetField(dart_mode, DOMDartState::Current()->value_handle()); 26 Dart_GetField(dart_mode, DOMDartState::Current()->value_handle());
27 27
28 uint64_t mode = 0; 28 uint64_t mode = 0;
29 Dart_Handle rv = Dart_IntegerToUint64(value, &mode); 29 Dart_Handle rv = Dart_IntegerToUint64(value, &mode);
30 DCHECK(!LogIfError(rv)); 30 DCHECK(!LogIfError(rv));
31 31
32 result.sk_mode = static_cast<SkXfermode::Mode>(mode); 32 result = static_cast<SkXfermode::Mode>(mode);
33 return result; 33 return result;
34 } 34 }
35 35
36 } // namespace blink 36 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/painting/TransferMode.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698