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

Side by Side Diff: samplecode/SampleAll.cpp

Issue 1422703009: Revert[4] of "stop using drawSprite (at least w/ no filters) as it is going away" (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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 | src/effects/SkColorFilterImageFilter.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SampleCode.h" 8 #include "SampleCode.h"
9 #include "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 // path 433 // path
434 canvas->translate(SkIntToScalar(50), 0); 434 canvas->translate(SkIntToScalar(50), 0);
435 paint.setColor(SK_ColorRED); 435 paint.setColor(SK_ColorRED);
436 paint.setStyle(SkPaint::kStroke_Style); 436 paint.setStyle(SkPaint::kStroke_Style);
437 paint.setStrokeWidth(SkIntToScalar(5)); 437 paint.setStrokeWidth(SkIntToScalar(5));
438 paint.setShader(radial)->unref(); 438 paint.setShader(radial)->unref();
439 paint.setMaskFilter(nullptr); 439 paint.setMaskFilter(nullptr);
440 canvas->drawPath(path, paint); 440 canvas->drawPath(path, paint);
441 441
442 paint.setShader(nullptr); 442 paint.setShader(nullptr);
443 // bitmap, sprite 443 // bitmap
444 canvas->translate(SkIntToScalar(50), 0); 444 canvas->translate(SkIntToScalar(50), 0);
445 paint.setStyle(SkPaint::kFill_Style); 445 paint.setStyle(SkPaint::kFill_Style);
446 canvas->drawBitmap(fBug, left, top, &paint); 446 canvas->drawBitmap(fBug, left, top, &paint);
447 canvas->translate(SkIntToScalar(30), 0);
448 canvas->drawSprite(fTb,
449 SkScalarRoundToInt(canvas->getTotalMatrix().getTranslateX()),
450 spriteOffset + 10, &paint);
451 447
452 canvas->translate(-SkIntToScalar(30), SkIntToScalar(30)); 448 canvas->translate(-SkIntToScalar(30), SkIntToScalar(30));
453 paint.setShader(shaderTest())->unref(); // test compose shader 449 paint.setShader(shaderTest())->unref(); // test compose shader
454 canvas->drawRect(rect2, paint); 450 canvas->drawRect(rect2, paint);
455 paint.setShader(nullptr); 451 paint.setShader(nullptr);
456 452
457 canvas->restore(); 453 canvas->restore();
458 // text 454 // text
459 canvas->translate(0, SkIntToScalar(60)); 455 canvas->translate(0, SkIntToScalar(60));
460 canvas->save(); 456 canvas->save();
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 private: 571 private:
576 SkPoint fClickPt; 572 SkPoint fClickPt;
577 SkBitmap fBug, fTb, fTx; 573 SkBitmap fBug, fTb, fTx;
578 typedef SampleView INHERITED; 574 typedef SampleView INHERITED;
579 }; 575 };
580 576
581 ////////////////////////////////////////////////////////////////////////////// 577 //////////////////////////////////////////////////////////////////////////////
582 578
583 static SkView* MyFactory() { return new DemoView; } 579 static SkView* MyFactory() { return new DemoView; }
584 static SkViewRegister reg(MyFactory); 580 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « no previous file | src/effects/SkColorFilterImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698