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

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

Issue 1170963003: Sky: Add a DartConverterEnum and use that for all our enum needs. (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: 360 no scope 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/TransferMode.h ('k') | sky/engine/core/script/dom_dart_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/painting/TransferMode.cpp
diff --git a/sky/engine/core/painting/TransferMode.cpp b/sky/engine/core/painting/TransferMode.cpp
deleted file mode 100644
index afd168e3d1425408ee6fa6d4d4af299c0cfec1fd..0000000000000000000000000000000000000000
--- a/sky/engine/core/painting/TransferMode.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "sky/engine/config.h"
-#include "sky/engine/core/painting/TransferMode.h"
-
-#include "sky/engine/core/script/dom_dart_state.h"
-#include "sky/engine/tonic/dart_builtin.h"
-#include "sky/engine/tonic/dart_error.h"
-#include "sky/engine/tonic/dart_value.h"
-
-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++
-// values.
-COMPILE_ASSERT(SkXfermode::kLastMode == 28, Need_to_update_TransferMode_dart);
-
-// Convert dart_mode => SkXfermode::Mode.
-SkXfermode::Mode DartConverter<TransferMode>::FromArgumentsWithNullCheck(
- Dart_NativeArguments args,
- int index,
- Dart_Handle& exception) {
- SkXfermode::Mode result;
-
- Dart_Handle dart_mode = Dart_GetNativeArgument(args, index);
- DCHECK(!LogIfError(dart_mode));
-
- Dart_Handle value =
- Dart_GetField(dart_mode, DOMDartState::Current()->index_handle());
-
- uint64_t mode = 0;
- Dart_Handle rv = Dart_IntegerToUint64(value, &mode);
- DCHECK(!LogIfError(rv));
-
- result = static_cast<SkXfermode::Mode>(mode);
- return result;
-}
-
-} // namespace blink
« no previous file with comments | « sky/engine/core/painting/TransferMode.h ('k') | sky/engine/core/script/dom_dart_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698