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

Side by Side Diff: gm/convexpolyclip.cpp

Issue 2357273003: Do not set bounds on SkLiteRecorder
Patch Set: Created 4 years, 2 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 2014 Google Inc. 2 * Copyright 2014 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 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 fBmp = make_bmp(100, 100); 137 fBmp = make_bmp(100, 100);
138 } 138 }
139 139
140 void onDraw(SkCanvas* canvas) override { 140 void onDraw(SkCanvas* canvas) override {
141 SkScalar y = 0; 141 SkScalar y = 0;
142 constexpr SkScalar kMargin = 10.f; 142 constexpr SkScalar kMargin = 10.f;
143 143
144 SkPaint bgPaint; 144 SkPaint bgPaint;
145 bgPaint.setAlpha(0x15); 145 bgPaint.setAlpha(0x15);
146 SkISize size = canvas->getDeviceSize(); 146 SkISize size = this->onISize();
147 canvas->drawBitmapRect(fBmp, SkRect::MakeIWH(size.fWidth, size.fHeight), &bgPaint); 147 canvas->drawBitmapRect(fBmp, SkRect::MakeIWH(size.fWidth, size.fHeight), &bgPaint);
148 148
149 constexpr char kTxt[] = "Clip Me!"; 149 constexpr char kTxt[] = "Clip Me!";
150 SkPaint txtPaint; 150 SkPaint txtPaint;
151 txtPaint.setTextSize(23.f); 151 txtPaint.setTextSize(23.f);
152 txtPaint.setAntiAlias(true); 152 txtPaint.setAntiAlias(true);
153 sk_tool_utils::set_portable_typeface(&txtPaint); 153 sk_tool_utils::set_portable_typeface(&txtPaint);
154 txtPaint.setColor(sk_tool_utils::color_to_565(SK_ColorDKGRAY)); 154 txtPaint.setColor(sk_tool_utils::color_to_565(SK_ColorDKGRAY));
155 SkScalar textW = txtPaint.measureText(kTxt, SK_ARRAY_COUNT(kTxt)-1); 155 SkScalar textW = txtPaint.measureText(kTxt, SK_ARRAY_COUNT(kTxt)-1);
156 156
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 292
293 typedef SkTLList<Clip, 1> ClipList; 293 typedef SkTLList<Clip, 1> ClipList;
294 ClipList fClips; 294 ClipList fClips;
295 SkBitmap fBmp; 295 SkBitmap fBmp;
296 296
297 typedef GM INHERITED; 297 typedef GM INHERITED;
298 }; 298 };
299 299
300 DEF_GM(return new ConvexPolyClip;) 300 DEF_GM(return new ConvexPolyClip;)
301 } 301 }
OLDNEW
« no previous file with comments | « gm/complexclip_blur_tiled.cpp ('k') | gm/imageblurtiled.cpp » ('j') | src/core/SkCanvas.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698