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

Side by Side Diff: src/utils/SkLua.cpp

Issue 1936283003: documentation: SkDocument::MakePDF() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-05-02 (Monday) 17:27:37 EDT Created 4 years, 7 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 | « site/user/sample/pdf.md ('k') | tools/fiddle/fiddle_main.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1932 matching lines...) Expand 10 before | Expand all | Expand 10 after
1943 #define AUTO_LUA(verb) AutoCallLua acl(fL, fFunc.c_str(), verb) 1943 #define AUTO_LUA(verb) AutoCallLua acl(fL, fFunc.c_str(), verb)
1944 1944
1945 /////////////////////////////////////////////////////////////////////////////// 1945 ///////////////////////////////////////////////////////////////////////////////
1946 1946
1947 static int lsk_newDocumentPDF(lua_State* L) { 1947 static int lsk_newDocumentPDF(lua_State* L) {
1948 const char* file = nullptr; 1948 const char* file = nullptr;
1949 if (lua_gettop(L) > 0 && lua_isstring(L, 1)) { 1949 if (lua_gettop(L) > 0 && lua_isstring(L, 1)) {
1950 file = lua_tolstring(L, 1, nullptr); 1950 file = lua_tolstring(L, 1, nullptr);
1951 } 1951 }
1952 1952
1953 SkDocument* doc = SkDocument::CreatePDF(file); 1953 sk_sp<SkDocument> doc = SkDocument::MakePDF(file);
1954 if (nullptr == doc) { 1954 if (nullptr == doc) {
1955 // do I need to push a nil on the stack and return 1? 1955 // do I need to push a nil on the stack and return 1?
1956 return 0; 1956 return 0;
1957 } else { 1957 } else {
1958 push_ref(L, doc)->unref(); 1958 push_ref(L, std::move(doc));
1959 return 1; 1959 return 1;
1960 } 1960 }
1961 } 1961 }
1962 1962
1963 static int lsk_newBlurImageFilter(lua_State* L) { 1963 static int lsk_newBlurImageFilter(lua_State* L) {
1964 SkScalar sigmaX = lua2scalar_def(L, 1, 0); 1964 SkScalar sigmaX = lua2scalar_def(L, 1, 0);
1965 SkScalar sigmaY = lua2scalar_def(L, 2, 0); 1965 SkScalar sigmaY = lua2scalar_def(L, 2, 0);
1966 sk_sp<SkImageFilter> imf(SkBlurImageFilter::Make(sigmaX, sigmaY, nullptr)); 1966 sk_sp<SkImageFilter> imf(SkBlurImageFilter::Make(sigmaX, sigmaY, nullptr));
1967 if (!imf) { 1967 if (!imf) {
1968 lua_pushnil(L); 1968 lua_pushnil(L);
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
2137 REG_CLASS(L, SkTextBlob); 2137 REG_CLASS(L, SkTextBlob);
2138 REG_CLASS(L, SkTypeface); 2138 REG_CLASS(L, SkTypeface);
2139 REG_CLASS(L, SkXfermode); 2139 REG_CLASS(L, SkXfermode);
2140 } 2140 }
2141 2141
2142 extern "C" int luaopen_skia(lua_State* L); 2142 extern "C" int luaopen_skia(lua_State* L);
2143 extern "C" int luaopen_skia(lua_State* L) { 2143 extern "C" int luaopen_skia(lua_State* L) {
2144 SkLua::Load(L); 2144 SkLua::Load(L);
2145 return 0; 2145 return 0;
2146 } 2146 }
OLDNEW
« no previous file with comments | « site/user/sample/pdf.md ('k') | tools/fiddle/fiddle_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698