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

Side by Side Diff: src/utils/debugger/SkDrawCommand.h

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 | « src/utils/debugger/SkDebugCanvas.cpp ('k') | src/utils/debugger/SkDrawCommand.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 2012 Google Inc. 3 * Copyright 2012 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 8
9 #ifndef SKDRAWCOMMAND_H_ 9 #ifndef SKDRAWCOMMAND_H_
10 #define SKDRAWCOMMAND_H_ 10 #define SKDRAWCOMMAND_H_
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 SkPaint fPaint; 222 SkPaint fPaint;
223 SkPaint* fPaintPtr; 223 SkPaint* fPaintPtr;
224 224
225 typedef SkDrawCommand INHERITED; 225 typedef SkDrawCommand INHERITED;
226 }; 226 };
227 227
228 class SkDrawBitmapRectCommand : public SkDrawCommand { 228 class SkDrawBitmapRectCommand : public SkDrawCommand {
229 public: 229 public:
230 SkDrawBitmapRectCommand(const SkBitmap& bitmap, const SkRect* src, 230 SkDrawBitmapRectCommand(const SkBitmap& bitmap, const SkRect* src,
231 const SkRect& dst, const SkPaint* paint, 231 const SkRect& dst, const SkPaint* paint,
232 SkCanvas::DrawBitmapRectFlags flags); 232 SkCanvas::SrcRectConstraint);
233 void execute(SkCanvas* canvas) const override; 233 void execute(SkCanvas* canvas) const override;
234 bool render(SkCanvas* canvas) const override; 234 bool render(SkCanvas* canvas) const override;
235 235
236 const SkBitmap& bitmap() const { return fBitmap; } 236 const SkBitmap& bitmap() const { return fBitmap; }
237 237
238 // The non-const 'paint' method allows modification of this object's 238 // The non-const 'paint' method allows modification of this object's
239 // SkPaint. For this reason the ctor and setPaint method make a local copy. 239 // SkPaint. For this reason the ctor and setPaint method make a local copy.
240 // The 'fPaintPtr' member acts a signal that the local SkPaint is valid 240 // The 'fPaintPtr' member acts a signal that the local SkPaint is valid
241 // (since only an SkPaint* is passed into the ctor). 241 // (since only an SkPaint* is passed into the ctor).
242 const SkPaint* paint() const { return fPaintPtr; } 242 const SkPaint* paint() const { return fPaintPtr; }
243 SkPaint* paint() { return fPaintPtr; } 243 SkPaint* paint() { return fPaintPtr; }
244 244
245 void setPaint(const SkPaint& paint) { fPaint = paint; fPaintPtr = &fPaint; } 245 void setPaint(const SkPaint& paint) { fPaint = paint; fPaintPtr = &fPaint; }
246 246
247 const SkRect* srcRect() const { return fSrc.isEmpty() ? NULL : &fSrc; } 247 const SkRect* srcRect() const { return fSrc.isEmpty() ? NULL : &fSrc; }
248 void setSrcRect(const SkRect& src) { fSrc = src; } 248 void setSrcRect(const SkRect& src) { fSrc = src; }
249 249
250 const SkRect& dstRect() const { return fDst; } 250 const SkRect& dstRect() const { return fDst; }
251 void setDstRect(const SkRect& dst) { fDst = dst; } 251 void setDstRect(const SkRect& dst) { fDst = dst; }
252 252
253 SkCanvas::DrawBitmapRectFlags flags() const { return fFlags; } 253 SkCanvas::SrcRectConstraint constraint() const { return fConstraint; }
254 void setFlags(SkCanvas::DrawBitmapRectFlags flags) { fFlags = flags; } 254 void setConstraint(SkCanvas::SrcRectConstraint constraint) { fConstraint = c onstraint; }
255 255
256 private: 256 private:
257 SkBitmap fBitmap; 257 SkBitmap fBitmap;
258 SkRect fSrc; 258 SkRect fSrc;
259 SkRect fDst; 259 SkRect fDst;
260 SkPaint fPaint; 260 SkPaint fPaint;
261 SkPaint* fPaintPtr; 261 SkPaint* fPaintPtr;
262 SkCanvas::DrawBitmapRectFlags fFlags; 262 SkCanvas::SrcRectConstraint fConstraint;
263 263
264 typedef SkDrawCommand INHERITED; 264 typedef SkDrawCommand INHERITED;
265 }; 265 };
266 266
267 class SkDrawOvalCommand : public SkDrawCommand { 267 class SkDrawOvalCommand : public SkDrawCommand {
268 public: 268 public:
269 SkDrawOvalCommand(const SkRect& oval, const SkPaint& paint); 269 SkDrawOvalCommand(const SkRect& oval, const SkPaint& paint);
270 void execute(SkCanvas* canvas) const override; 270 void execute(SkCanvas* canvas) const override;
271 bool render(SkCanvas* canvas) const override; 271 bool render(SkCanvas* canvas) const override;
272 private: 272 private:
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 void setUserMatrix(const SkMatrix&) override; 558 void setUserMatrix(const SkMatrix&) override;
559 void execute(SkCanvas* canvas) const override; 559 void execute(SkCanvas* canvas) const override;
560 private: 560 private:
561 SkMatrix fUserMatrix; 561 SkMatrix fUserMatrix;
562 SkMatrix fMatrix; 562 SkMatrix fMatrix;
563 563
564 typedef SkDrawCommand INHERITED; 564 typedef SkDrawCommand INHERITED;
565 }; 565 };
566 566
567 #endif 567 #endif
OLDNEW
« no previous file with comments | « src/utils/debugger/SkDebugCanvas.cpp ('k') | src/utils/debugger/SkDrawCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698