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

Unified Diff: sky/engine/core/painting/PaintingStyle.cpp

Issue 1171543002: Use an enum for Dart bindings for Skia Paint style (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/painting/PaintingStyle.h ('k') | sky/engine/core/painting/PaintingStyle.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/painting/PaintingStyle.cpp
diff --git a/sky/engine/core/painting/TransferMode.cpp b/sky/engine/core/painting/PaintingStyle.cpp
similarity index 50%
copy from sky/engine/core/painting/TransferMode.cpp
copy to sky/engine/core/painting/PaintingStyle.cpp
index afd168e3d1425408ee6fa6d4d4af299c0cfec1fd..31f39e0287c60198cf32fa6653fd1b0a9bd129d0 100644
--- a/sky/engine/core/painting/TransferMode.cpp
+++ b/sky/engine/core/painting/PaintingStyle.cpp
@@ -3,7 +3,7 @@
// found in the LICENSE file.
#include "sky/engine/config.h"
-#include "sky/engine/core/painting/TransferMode.h"
+#include "sky/engine/core/painting/PaintingStyle.h"
#include "sky/engine/core/script/dom_dart_state.h"
#include "sky/engine/tonic/dart_builtin.h"
@@ -13,28 +13,28 @@
namespace blink {
// If this fails, it's because SkXfermode has changed. We need to change
-// TransferMode.dart to ensure the TransferMode enum is in sync with the C++
+// PaintingStyle.dart to ensure the PaintingStyle enum is in sync with the C++
// values.
-COMPILE_ASSERT(SkXfermode::kLastMode == 28, Need_to_update_TransferMode_dart);
+COMPILE_ASSERT(SkPaint::kStyleCount == 3, Need_to_update_PaintingStyle_dart);
-// Convert dart_mode => SkXfermode::Mode.
-SkXfermode::Mode DartConverter<TransferMode>::FromArgumentsWithNullCheck(
+// Convert dart_style => SkPaint::Style.
+SkPaint::Style DartConverter<PaintingStyle>::FromArgumentsWithNullCheck(
Dart_NativeArguments args,
int index,
Dart_Handle& exception) {
- SkXfermode::Mode result;
+ SkPaint::Style result;
- Dart_Handle dart_mode = Dart_GetNativeArgument(args, index);
- DCHECK(!LogIfError(dart_mode));
+ Dart_Handle dart_style = Dart_GetNativeArgument(args, index);
+ DCHECK(!LogIfError(dart_style));
Dart_Handle value =
- Dart_GetField(dart_mode, DOMDartState::Current()->index_handle());
+ Dart_GetField(dart_style, DOMDartState::Current()->index_handle());
- uint64_t mode = 0;
- Dart_Handle rv = Dart_IntegerToUint64(value, &mode);
+ uint64_t style = 0;
+ Dart_Handle rv = Dart_IntegerToUint64(value, &style);
DCHECK(!LogIfError(rv));
- result = static_cast<SkXfermode::Mode>(mode);
+ result = static_cast<SkPaint::Style>(style);
return result;
}
« no previous file with comments | « sky/engine/core/painting/PaintingStyle.h ('k') | sky/engine/core/painting/PaintingStyle.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698