OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkLua.h" | 8 #include "SkLua.h" |
9 | 9 |
10 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 } | 631 } |
632 | 632 |
633 static int lcanvas_getClipStack(lua_State* L) { | 633 static int lcanvas_getClipStack(lua_State* L) { |
634 SkLua(L).pushClipStack(*get_ref<SkCanvas>(L, 1)->getClipStack()); | 634 SkLua(L).pushClipStack(*get_ref<SkCanvas>(L, 1)->getClipStack()); |
635 return 1; | 635 return 1; |
636 } | 636 } |
637 | 637 |
638 int SkLua::lcanvas_getReducedClipStack(lua_State* L) { | 638 int SkLua::lcanvas_getReducedClipStack(lua_State* L) { |
639 #if SK_SUPPORT_GPU | 639 #if SK_SUPPORT_GPU |
640 const SkCanvas* canvas = get_ref<SkCanvas>(L, 1); | 640 const SkCanvas* canvas = get_ref<SkCanvas>(L, 1); |
641 SkIRect queryBounds = canvas->getTopLayerBounds(); | 641 SkRect queryBounds = SkRect::Make(canvas->getTopLayerBounds()); |
642 | 642 |
643 GrReducedClip::ElementList elements; | 643 GrReducedClip::ElementList elements; |
644 GrReducedClip::InitialState initialState; | |
645 int32_t genID; | 644 int32_t genID; |
646 SkIRect resultBounds; | 645 SkIRect resultBounds; |
| 646 bool requiresAA; |
647 | 647 |
648 const SkClipStack& stack = *canvas->getClipStack(); | 648 const SkClipStack& stack = *canvas->getClipStack(); |
649 | 649 |
650 GrReducedClip::ReduceClipStack(stack, | 650 GrReducedClip::ReduceClipStack(stack, |
651 queryBounds, | 651 queryBounds, |
652 &elements, | 652 &elements, |
653 &genID, | 653 &genID, |
654 &initialState, | |
655 &resultBounds, | 654 &resultBounds, |
656 nullptr); | 655 &requiresAA); |
657 | 656 |
658 GrReducedClip::ElementList::Iter iter(elements); | 657 GrReducedClip::ElementList::Iter iter(elements); |
659 int i = 0; | 658 int i = 0; |
660 lua_newtable(L); | 659 lua_newtable(L); |
661 while(iter.get()) { | 660 while(iter.get()) { |
662 SkLua(L).pushClipStackElement(*iter.get()); | 661 SkLua(L).pushClipStackElement(*iter.get()); |
663 iter.next(); | 662 iter.next(); |
664 lua_rawseti(L, -2, ++i); | 663 lua_rawseti(L, -2, ++i); |
665 } | 664 } |
666 // Currently this only returns the element list to lua, not the initial stat
e or result bounds. | 665 // Currently this only returns the element list to lua, not the initial stat
e or result bounds. |
(...skipping 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2136 REG_CLASS(L, SkTextBlob); | 2135 REG_CLASS(L, SkTextBlob); |
2137 REG_CLASS(L, SkTypeface); | 2136 REG_CLASS(L, SkTypeface); |
2138 REG_CLASS(L, SkXfermode); | 2137 REG_CLASS(L, SkXfermode); |
2139 } | 2138 } |
2140 | 2139 |
2141 extern "C" int luaopen_skia(lua_State* L); | 2140 extern "C" int luaopen_skia(lua_State* L); |
2142 extern "C" int luaopen_skia(lua_State* L) { | 2141 extern "C" int luaopen_skia(lua_State* L) { |
2143 SkLua::Load(L); | 2142 SkLua::Load(L); |
2144 return 0; | 2143 return 0; |
2145 } | 2144 } |
OLD | NEW |