diff options
author | 2018-03-06 13:00:52 -0500 | |
---|---|---|
committer | 2018-03-06 19:06:16 +0000 | |
commit | e041e31926f88bf76d8d29eb77868bb8b3749044 (patch) | |
tree | c5c737db037eeff506e7e89e6d01b5372c4bdaad | |
parent | 5fa27116cd8051a5d78e1f49d2caab66b991a493 (diff) |
remove canvas internal private
interfaces not called externally
and aren't used internally
R=robertphillips@google.com,reed@google.com
Bug: skia:6455
Change-Id: Iee98ce4380a28a831d9bffe99932b54421dd339a
Reviewed-on: https://skia-review.googlesource.com/112481
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
-rw-r--r-- | include/core/SkCanvas.h | 6 | ||||
-rw-r--r-- | src/core/SkCanvas.cpp | 27 | ||||
-rw-r--r-- | tests/RecordDrawTest.cpp | 8 |
3 files changed, 6 insertions, 35 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index 793f4abd90..a9adc48722 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -2428,12 +2428,6 @@ public: // don't call virtual GrRenderTargetContext* internal_private_accessTopLayerRenderTargetContext(); - // don't call - static void Internal_Private_SetIgnoreSaveLayerBounds(bool); - static bool Internal_Private_GetIgnoreSaveLayerBounds(); - static void Internal_Private_SetTreatSpriteAsBitmap(bool); - static bool Internal_Private_GetTreatSpriteAsBitmap(); - // TEMP helpers until we switch virtual over to const& for src-rect void legacy_drawImageRect(const SkImage* image, const SkRect* src, const SkRect& dst, const SkPaint* paint, diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 34b9d369ec..94bc2a711c 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -169,22 +169,6 @@ bool SkCanvas::wouldOverwriteEntireSurface(const SkRect* rect, const SkPaint* pa /////////////////////////////////////////////////////////////////////////////////////////////////// -static bool gIgnoreSaveLayerBounds; -void SkCanvas::Internal_Private_SetIgnoreSaveLayerBounds(bool ignore) { - gIgnoreSaveLayerBounds = ignore; -} -bool SkCanvas::Internal_Private_GetIgnoreSaveLayerBounds() { - return gIgnoreSaveLayerBounds; -} - -static bool gTreatSpriteAsBitmap; -void SkCanvas::Internal_Private_SetTreatSpriteAsBitmap(bool spriteAsBitmap) { - gTreatSpriteAsBitmap = spriteAsBitmap; -} -bool SkCanvas::Internal_Private_GetTreatSpriteAsBitmap() { - return gTreatSpriteAsBitmap; -} - // experimental for faster tiled drawing... //#define SK_TRACE_SAVERESTORE @@ -999,15 +983,10 @@ int SkCanvas::saveLayerPreserveLCDTextRequests(const SkRect* bounds, const SkPai return this->saveLayer(SaveLayerRec(bounds, paint, kPreserveLCDText_SaveLayerFlag)); } -int SkCanvas::saveLayer(const SaveLayerRec& origRec) { - SkTCopyOnFirstWrite<SaveLayerRec> rec(origRec); - if (gIgnoreSaveLayerBounds) { - rec.writable()->fBounds = nullptr; - } - - SaveLayerStrategy strategy = this->getSaveLayerStrategy(*rec); +int SkCanvas::saveLayer(const SaveLayerRec& rec) { + SaveLayerStrategy strategy = this->getSaveLayerStrategy(rec); fSaveCount += 1; - this->internalSaveLayer(*rec, strategy); + this->internalSaveLayer(rec, strategy); return this->getSaveCount() - 1; } diff --git a/tests/RecordDrawTest.cpp b/tests/RecordDrawTest.cpp index f50081fd29..216865056a 100644 --- a/tests/RecordDrawTest.cpp +++ b/tests/RecordDrawTest.cpp @@ -249,11 +249,9 @@ DEF_TEST(RecordDraw_SaveLayerBoundsAffectsClipBounds, r) { SkAutoTMalloc<SkRect> bounds(record.count()); SkRecordFillBounds(SkRect::MakeWH(50, 50), record, bounds); - if (!SkCanvas::Internal_Private_GetIgnoreSaveLayerBounds()) { - REPORTER_ASSERT(r, sloppy_rect_eq(bounds[0], SkRect::MakeLTRB(10, 10, 40, 40))); - REPORTER_ASSERT(r, sloppy_rect_eq(bounds[1], SkRect::MakeLTRB(20, 20, 30, 30))); - REPORTER_ASSERT(r, sloppy_rect_eq(bounds[2], SkRect::MakeLTRB(10, 10, 40, 40))); - } + REPORTER_ASSERT(r, sloppy_rect_eq(bounds[0], SkRect::MakeLTRB(10, 10, 40, 40))); + REPORTER_ASSERT(r, sloppy_rect_eq(bounds[1], SkRect::MakeLTRB(20, 20, 30, 30))); + REPORTER_ASSERT(r, sloppy_rect_eq(bounds[2], SkRect::MakeLTRB(10, 10, 40, 40))); } DEF_TEST(RecordDraw_drawImage, r){ |