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

Side by Side Diff: include/core/SkCanvas.h

Issue 1523053003: add backdrop option to SaveLayerRec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: updated gm to exercise ctm scaling Created 5 years 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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 #ifndef SkCanvas_DEFINED 8 #ifndef SkCanvas_DEFINED
9 #define SkCanvas_DEFINED 9 #define SkCanvas_DEFINED
10 10
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 SK_ATTR_EXTERNALLY_DEPRECATED("SaveFlags use is deprecated") 391 SK_ATTR_EXTERNALLY_DEPRECATED("SaveFlags use is deprecated")
392 int saveLayerAlpha(const SkRect* bounds, U8CPU alpha, SaveFlags flags); 392 int saveLayerAlpha(const SkRect* bounds, U8CPU alpha, SaveFlags flags);
393 393
394 enum { 394 enum {
395 kIsOpaque_SaveLayerFlag = 1 << 0, 395 kIsOpaque_SaveLayerFlag = 1 << 0,
396 kPreserveLCDText_SaveLayerFlag = 1 << 1, 396 kPreserveLCDText_SaveLayerFlag = 1 << 1,
397 }; 397 };
398 typedef uint32_t SaveLayerFlags; 398 typedef uint32_t SaveLayerFlags;
399 399
400 struct SaveLayerRec { 400 struct SaveLayerRec {
401 SaveLayerRec() : fBounds(nullptr), fPaint(nullptr), fSaveLayerFlags(0) { } 401 SaveLayerRec()
402 : fBounds(nullptr), fPaint(nullptr), fBackdrop(nullptr), fSaveLayerF lags(0)
403 {}
402 SaveLayerRec(const SkRect* bounds, const SkPaint* paint, SaveLayerFlags saveLayerFlags = 0) 404 SaveLayerRec(const SkRect* bounds, const SkPaint* paint, SaveLayerFlags saveLayerFlags = 0)
403 : fBounds(bounds) 405 : fBounds(bounds)
404 , fPaint(paint) 406 , fPaint(paint)
407 , fBackdrop(nullptr)
408 , fSaveLayerFlags(saveLayerFlags)
409 {}
410 SaveLayerRec(const SkRect* bounds, const SkPaint* paint, const SkImageFi lter* backdrop,
411 SaveLayerFlags saveLayerFlags)
412 : fBounds(bounds)
413 , fPaint(paint)
414 , fBackdrop(backdrop)
405 , fSaveLayerFlags(saveLayerFlags) 415 , fSaveLayerFlags(saveLayerFlags)
406 {} 416 {}
407 417
408 const SkRect* fBounds; // optional 418 const SkRect* fBounds; // optional
409 const SkPaint* fPaint; // optional 419 const SkPaint* fPaint; // optional
410 SaveLayerFlags fSaveLayerFlags; 420 const SkImageFilter* fBackdrop; // optional
421 SaveLayerFlags fSaveLayerFlags;
411 }; 422 };
412 423
413 int saveLayer(const SaveLayerRec&); 424 int saveLayer(const SaveLayerRec&);
414 425
415 /** This call balances a previous call to save(), and is used to remove all 426 /** This call balances a previous call to save(), and is used to remove all
416 modifications to the matrix/clip/drawFilter state since the last save 427 modifications to the matrix/clip/drawFilter state since the last save
417 call. 428 call.
418 It is an error to call restore() more times than save() was called. 429 It is an error to call restore() more times than save() was called.
419 */ 430 */
420 void restore(); 431 void restore();
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1594 1605
1595 class SkCanvasClipVisitor { 1606 class SkCanvasClipVisitor {
1596 public: 1607 public:
1597 virtual ~SkCanvasClipVisitor(); 1608 virtual ~SkCanvasClipVisitor();
1598 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0; 1609 virtual void clipRect(const SkRect&, SkRegion::Op, bool antialias) = 0;
1599 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0; 1610 virtual void clipRRect(const SkRRect&, SkRegion::Op, bool antialias) = 0;
1600 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0; 1611 virtual void clipPath(const SkPath&, SkRegion::Op, bool antialias) = 0;
1601 }; 1612 };
1602 1613
1603 #endif 1614 #endif
OLDNEW
« no previous file with comments | « gm/imagefilters.cpp ('k') | samplecode/SampleLayers.cpp » ('j') | samplecode/SampleLayers.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698