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

Side by Side Diff: src/core/SkLiteDL.cpp

Issue 2234483002: SkLiteDL: add some missing std::move() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | no next file » | 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 2016 Google Inc. 2 * Copyright 2016 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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkData.h" 9 #include "SkData.h"
10 #include "SkImageFilter.h" 10 #include "SkImageFilter.h"
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 #ifdef SK_EXPERIMENTAL_SHADOWING 234 #ifdef SK_EXPERIMENTAL_SHADOWING
235 c->drawShadowedPicture(picture.get(), &matrix, &paint); 235 c->drawShadowedPicture(picture.get(), &matrix, &paint);
236 #endif 236 #endif
237 } 237 }
238 void optimizeFor(GrContext* ctx) override { optimize_for(ctx, &paint); } 238 void optimizeFor(GrContext* ctx) override { optimize_for(ctx, &paint); }
239 void makeThreadsafe() override { make_threadsafe(nullptr, &matrix); } 239 void makeThreadsafe() override { make_threadsafe(nullptr, &matrix); }
240 }; 240 };
241 241
242 struct DrawImage final : Op { 242 struct DrawImage final : Op {
243 DrawImage(sk_sp<const SkImage>&& image, SkScalar x, SkScalar y, const Sk Paint* paint) 243 DrawImage(sk_sp<const SkImage>&& image, SkScalar x, SkScalar y, const Sk Paint* paint)
244 : image(image), x(x), y(y) { 244 : image(std::move(image)), x(x), y(y) {
245 if (paint) { this->paint = *paint; } 245 if (paint) { this->paint = *paint; }
246 } 246 }
247 sk_sp<const SkImage> image; 247 sk_sp<const SkImage> image;
248 SkScalar x,y; 248 SkScalar x,y;
249 SkPaint paint; 249 SkPaint paint;
250 void draw(SkCanvas* c) override { c->drawImage(image.get(), x,y, &paint) ; } 250 void draw(SkCanvas* c) override { c->drawImage(image.get(), x,y, &paint) ; }
251 void optimizeFor(GrContext* ctx) override { optimize_for(ctx, &paint, &i mage); } 251 void optimizeFor(GrContext* ctx) override { optimize_for(ctx, &paint, &i mage); }
252 }; 252 };
253 struct DrawImageNine final : Op { 253 struct DrawImageNine final : Op {
254 DrawImageNine(sk_sp<const SkImage>&& image, 254 DrawImageNine(sk_sp<const SkImage>&& image,
255 const SkIRect& center, const SkRect& dst, const SkPaint* p aint) 255 const SkIRect& center, const SkRect& dst, const SkPaint* p aint)
256 : image(image), center(center), dst(dst) { 256 : image(std::move(image)), center(center), dst(dst) {
257 if (paint) { this->paint = *paint; } 257 if (paint) { this->paint = *paint; }
258 } 258 }
259 sk_sp<const SkImage> image; 259 sk_sp<const SkImage> image;
260 SkIRect center; 260 SkIRect center;
261 SkRect dst; 261 SkRect dst;
262 SkPaint paint; 262 SkPaint paint;
263 void draw(SkCanvas* c) override { c->drawImageNine(image.get(), center, dst, &paint); } 263 void draw(SkCanvas* c) override { c->drawImageNine(image.get(), center, dst, &paint); }
264 void optimizeFor(GrContext* ctx) override { optimize_for(ctx, &paint, &i mage); } 264 void optimizeFor(GrContext* ctx) override { optimize_for(ctx, &paint, &i mage); }
265 }; 265 };
266 struct DrawImageRect final : Op { 266 struct DrawImageRect final : Op {
267 DrawImageRect(sk_sp<const SkImage>&& image, const SkRect* src, const SkR ect& dst, 267 DrawImageRect(sk_sp<const SkImage>&& image, const SkRect* src, const SkR ect& dst,
268 const SkPaint* paint, SkCanvas::SrcRectConstraint constrai nt) 268 const SkPaint* paint, SkCanvas::SrcRectConstraint constrai nt)
269 : image(image), dst(dst), constraint(constraint) { 269 : image(std::move(image)), dst(dst), constraint(constraint) {
270 this->src = src ? *src : SkRect::MakeIWH(image->width(), image->heig ht()); 270 this->src = src ? *src : SkRect::MakeIWH(image->width(), image->heig ht());
271 if (paint) { this->paint = *paint; } 271 if (paint) { this->paint = *paint; }
272 } 272 }
273 sk_sp<const SkImage> image; 273 sk_sp<const SkImage> image;
274 SkRect src, dst; 274 SkRect src, dst;
275 SkPaint paint; 275 SkPaint paint;
276 SkCanvas::SrcRectConstraint constraint; 276 SkCanvas::SrcRectConstraint constraint;
277 void draw(SkCanvas* c) override { 277 void draw(SkCanvas* c) override {
278 c->drawImageRect(image.get(), src, dst, &paint, constraint); 278 c->drawImageRect(image.get(), src, dst, &paint, constraint);
279 } 279 }
280 void optimizeFor(GrContext* ctx) override { optimize_for(ctx, &paint, &i mage); } 280 void optimizeFor(GrContext* ctx) override { optimize_for(ctx, &paint, &i mage); }
281 }; 281 };
282 struct DrawImageLattice final : Op { 282 struct DrawImageLattice final : Op {
283 DrawImageLattice(sk_sp<const SkImage>&& image, int xs, int ys, 283 DrawImageLattice(sk_sp<const SkImage>&& image, int xs, int ys,
284 const SkRect& dst, const SkPaint* paint) 284 const SkRect& dst, const SkPaint* paint)
285 : image(image), xs(xs), ys(ys), dst(dst) { 285 : image(std::move(image)), xs(xs), ys(ys), dst(dst) {
286 if (paint) { this->paint = *paint; } 286 if (paint) { this->paint = *paint; }
287 } 287 }
288 sk_sp<const SkImage> image; 288 sk_sp<const SkImage> image;
289 int xs, ys; 289 int xs, ys;
290 SkRect dst; 290 SkRect dst;
291 SkPaint paint; 291 SkPaint paint;
292 void draw(SkCanvas* c) override { 292 void draw(SkCanvas* c) override {
293 auto xdivs = pod<int>(this, 0), 293 auto xdivs = pod<int>(this, 0),
294 ydivs = pod<int>(this, xs*sizeof(int)); 294 ydivs = pod<int>(this, xs*sizeof(int));
295 c->drawImageLattice(image.get(), {xdivs, xs, ydivs, ys}, dst, &paint ); 295 c->drawImageLattice(image.get(), {xdivs, xs, ydivs, ys}, dst, &paint );
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 } 714 }
715 715
716 void SkLiteDL::PurgeFreelist() { 716 void SkLiteDL::PurgeFreelist() {
717 SkAutoMutexAcquire lock(gFreeStackLock); 717 SkAutoMutexAcquire lock(gFreeStackLock);
718 while (gFreeStack) { 718 while (gFreeStack) {
719 SkLiteDL* top = gFreeStack; 719 SkLiteDL* top = gFreeStack;
720 gFreeStack = gFreeStack->fNext; 720 gFreeStack = gFreeStack->fNext;
721 delete top; // Calling unref() here would just put it back on the list ! 721 delete top; // Calling unref() here would just put it back on the list !
722 } 722 }
723 } 723 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698