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

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

Issue 1272713005: flag to use const& instead of const* for src-rect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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
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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 SkCanvas* canvas = get_ref<SkCanvas>(L, 1); 523 SkCanvas* canvas = get_ref<SkCanvas>(L, 1);
524 SkImage* image = get_ref<SkImage>(L, 2); 524 SkImage* image = get_ref<SkImage>(L, 2);
525 if (NULL == image) { 525 if (NULL == image) {
526 return 0; 526 return 0;
527 } 527 }
528 528
529 SkRect srcR, dstR; 529 SkRect srcR, dstR;
530 SkRect* srcRPtr = NULL; 530 SkRect* srcRPtr = NULL;
531 if (!lua_isnil(L, 3)) { 531 if (!lua_isnil(L, 3)) {
532 srcRPtr = lua2rect(L, 3, &srcR); 532 srcRPtr = lua2rect(L, 3, &srcR);
533 } 533 }
robertphillips 2015/08/06 17:23:00 else { srcR = SkRect::MakeWH(image->width(), i
534 lua2rect(L, 4, &dstR); 534 lua2rect(L, 4, &dstR);
535 535
536 SkPaint paint; 536 SkPaint paint;
537 canvas->drawImageRect(image, srcRPtr, dstR, lua2OptionalPaint(L, 5, &paint)) ; 537 canvas->legacy_drawImageRect(image, srcRPtr, dstR, lua2OptionalPaint(L, 5, & paint));
538 return 0; 538 return 0;
539 } 539 }
540 540
541 static int lcanvas_drawPatch(lua_State* L) { 541 static int lcanvas_drawPatch(lua_State* L) {
542 SkPoint cubics[12]; 542 SkPoint cubics[12];
543 SkColor colorStorage[4]; 543 SkColor colorStorage[4];
544 SkPoint texStorage[4]; 544 SkPoint texStorage[4];
545 545
546 const SkColor* colors = NULL; 546 const SkColor* colors = NULL;
547 const SkPoint* texs = NULL; 547 const SkPoint* texs = NULL;
(...skipping 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after
2065 REG_CLASS(L, SkSurface); 2065 REG_CLASS(L, SkSurface);
2066 REG_CLASS(L, SkTextBlob); 2066 REG_CLASS(L, SkTextBlob);
2067 REG_CLASS(L, SkTypeface); 2067 REG_CLASS(L, SkTypeface);
2068 } 2068 }
2069 2069
2070 extern "C" int luaopen_skia(lua_State* L); 2070 extern "C" int luaopen_skia(lua_State* L);
2071 extern "C" int luaopen_skia(lua_State* L) { 2071 extern "C" int luaopen_skia(lua_State* L) {
2072 SkLua::Load(L); 2072 SkLua::Load(L);
2073 return 0; 2073 return 0;
2074 } 2074 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698