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

Unified Diff: src/utils/SkLua.cpp

Issue 2396953002: Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints" (Closed)
Patch Set: add tmp virtual to unroll legacy arithmodes Created 4 years, 2 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 | « src/utils/SkDumpCanvas.cpp ('k') | src/utils/SkRGBAToYUV.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkLua.cpp
diff --git a/src/utils/SkLua.cpp b/src/utils/SkLua.cpp
index e80708c71ce58d2179a5c7b7b866a934c92a4caa..ba311af61ca362078adcff1068c886ad94b405ae 100644
--- a/src/utils/SkLua.cpp
+++ b/src/utils/SkLua.cpp
@@ -28,7 +28,6 @@
#include "SkSurface.h"
#include "SkTextBlob.h"
#include "SkTypeface.h"
-#include "SkXfermode.h"
extern "C" {
#include "lua.h"
@@ -59,7 +58,6 @@ DEF_MTNAME(SkShader)
DEF_MTNAME(SkSurface)
DEF_MTNAME(SkTextBlob)
DEF_MTNAME(SkTypeface)
-DEF_MTNAME(SkXfermode)
template <typename T> T* push_new(lua_State* L) {
T* addr = (T*)lua_newuserdata(L, sizeof(T));
@@ -1073,26 +1071,9 @@ static int lpaint_getEffects(lua_State* L) {
setfield_bool_if(L, "shader", !!paint->getShader());
setfield_bool_if(L, "colorFilter", !!paint->getColorFilter());
setfield_bool_if(L, "imageFilter", !!paint->getImageFilter());
- setfield_bool_if(L, "xfermode", !!paint->getXfermode());
return 1;
}
-static int lpaint_getXfermode(lua_State* L) {
- const SkPaint* paint = get_obj<SkPaint>(L, 1);
- SkXfermode* xfermode = paint->getXfermode();
- if (xfermode) {
- push_ref(L, xfermode);
- return 1;
- }
- return 0;
-}
-
-static int lpaint_setXfermode(lua_State* L) {
- SkPaint* paint = get_obj<SkPaint>(L, 1);
- paint->setXfermode(sk_ref_sp(get_ref<SkXfermode>(L, 2)));
- return 0;
-}
-
static int lpaint_getColorFilter(lua_State* L) {
const SkPaint* paint = get_obj<SkPaint>(L, 1);
SkColorFilter* cf = paint->getColorFilter();
@@ -1217,8 +1198,6 @@ static const struct luaL_Reg gSkPaint_Methods[] = {
{ "setColorFilter", lpaint_setColorFilter },
{ "getImageFilter", lpaint_getImageFilter },
{ "setImageFilter", lpaint_setImageFilter },
- { "getXfermode", lpaint_getXfermode },
- { "setXfermode", lpaint_setXfermode },
{ "getShader", lpaint_getShader },
{ "setShader", lpaint_setShader },
{ "getPathEffect", lpaint_getPathEffect },
@@ -1341,24 +1320,6 @@ static const struct luaL_Reg gSkPathEffect_Methods[] = {
///////////////////////////////////////////////////////////////////////////////
-static int lpxfermode_getTypeName(lua_State* L) {
- lua_pushstring(L, get_ref<SkXfermode>(L, 1)->getTypeName());
- return 1;
-}
-
-static int lpxfermode_gc(lua_State* L) {
- get_ref<SkXfermode>(L, 1)->unref();
- return 0;
-}
-
-static const struct luaL_Reg gSkXfermode_Methods[] = {
- { "getTypeName", lpxfermode_getTypeName },
- { "__gc", lpxfermode_gc },
- { nullptr, nullptr }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-
static int lpcolorfilter_gc(lua_State* L) {
get_ref<SkColorFilter>(L, 1)->unref();
return 0;
@@ -2178,7 +2139,6 @@ void SkLua::Load(lua_State* L) {
REG_CLASS(L, SkSurface);
REG_CLASS(L, SkTextBlob);
REG_CLASS(L, SkTypeface);
- REG_CLASS(L, SkXfermode);
}
extern "C" int luaopen_skia(lua_State* L);
« no previous file with comments | « src/utils/SkDumpCanvas.cpp ('k') | src/utils/SkRGBAToYUV.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698