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

Side by Side Diff: gm/bitmaprecttest.cpp

Issue 1228083004: add src-rect-constraint to drawImageRect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 5 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 | « gm/bitmaprect.cpp ('k') | gm/bleed.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 "gm.h" 8 #include "gm.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 10
(...skipping 24 matching lines...) Expand all
35 // 35 //
36 static void test_bitmaprect(SkCanvas* canvas) { 36 static void test_bitmaprect(SkCanvas* canvas) {
37 SkBitmap bm; 37 SkBitmap bm;
38 make_bm(&bm); 38 make_bm(&bm);
39 39
40 canvas->drawBitmap(bm, 150, 45, NULL); 40 canvas->drawBitmap(bm, 150, 45, NULL);
41 41
42 SkScalar scale = 0.472560018f; 42 SkScalar scale = 0.472560018f;
43 canvas->save(); 43 canvas->save();
44 canvas->scale(scale, scale); 44 canvas->scale(scale, scale);
45 canvas->drawBitmapRectToRect(bm, NULL, SkRect::MakeXYWH(100, 100, 128, 128), NULL); 45 canvas->drawBitmapRect(bm, SkRect::MakeXYWH(100, 100, 128, 128));
46 canvas->restore(); 46 canvas->restore();
47 47
48 canvas->scale(-1, 1); 48 canvas->scale(-1, 1);
49 canvas->drawBitmap(bm, -310, 45, NULL); 49 canvas->drawBitmap(bm, -310, 45, NULL);
50 } 50 }
51 51
52 class BitmapRectTestGM : public skiagm::GM { 52 class BitmapRectTestGM : public skiagm::GM {
53 public: 53 public:
54 BitmapRectTestGM() { 54 BitmapRectTestGM() {
55 55
(...skipping 12 matching lines...) Expand all
68 test_bitmaprect(canvas); 68 test_bitmaprect(canvas);
69 } 69 }
70 70
71 private: 71 private:
72 typedef skiagm::GM INHERITED; 72 typedef skiagm::GM INHERITED;
73 }; 73 };
74 74
75 ////////////////////////////////////////////////////////////////////////////// 75 //////////////////////////////////////////////////////////////////////////////
76 76
77 DEF_GM( return new BitmapRectTestGM; ) 77 DEF_GM( return new BitmapRectTestGM; )
OLDNEW
« no previous file with comments | « gm/bitmaprect.cpp ('k') | gm/bleed.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698