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

Unified Diff: src/core/SkCanvas.cpp

Issue 1513513002: try adding flag to allow lcd text even in a layer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 0c9c20d1eed231c1ac72d8d0cfeb8e1886e759d4..dcec76fa2c237be39ec29e16ffa6b8124f5d3610 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1140,6 +1140,12 @@ int SkCanvas::saveLayer(const SkRect* bounds, const SkPaint* paint, SaveFlags fl
return this->getSaveCount() - 1;
}
+int SkCanvas::saveLayerAllowLCDText(const SkRect* bounds, const SkPaint* paint) {
+ unsigned flags = kARGB_ClipLayer_SaveFlag | kAllowLDCText_PrivateSaveFlag;
+ return this->saveLayer(bounds, paint, (SaveFlags)flags);
+}
+
+
void SkCanvas::internalSaveLayer(const SkRect* bounds, const SkPaint* paint, SaveFlags flags,
SaveLayerStrategy strategy) {
#ifndef SK_SUPPORT_LEGACY_CLIPTOLAYERFLAG
@@ -1183,8 +1189,11 @@ void SkCanvas::internalSaveLayer(const SkRect* bounds, const SkPaint* paint, Sav
bool forceSpriteOnRestore = false;
{
+ const bool allowLCD = kOpaque_SkAlphaType == info.alphaType() ||
+ SkToBool(flags & kAllowLDCText_PrivateSaveFlag);
const SkBaseDevice::TileUsage usage = SkBaseDevice::kNever_TileUsage;
- const SkBaseDevice::CreateInfo createInfo = SkBaseDevice::CreateInfo(info, usage, geo);
+ const SkBaseDevice::CreateInfo createInfo = SkBaseDevice::CreateInfo(info, usage, geo,
+ allowLCD, false);
SkBaseDevice* newDev = device->onCreateDevice(createInfo, paint);
if (nullptr == newDev) {
// If onCreateDevice didn't succeed, try raster (e.g. PDF couldn't handle the paint)
« no previous file with comments | « include/core/SkDevice.h ('k') | src/core/SkDevice.cpp » ('j') | src/core/SkDevice.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698