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

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: hobgoblins 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
« no previous file with comments | « include/core/SkDevice.h ('k') | src/core/SkDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkCanvas.cpp
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 0c9c20d1eed231c1ac72d8d0cfeb8e1886e759d4..1d37e584193e83fa0979117b964cc6195ba15d77 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::saveLayerPreserveLCDTextRequests(const SkRect* bounds, const SkPaint* paint) {
+ unsigned flags = kARGB_ClipLayer_SaveFlag | kPreserveLCDText_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 preserveLCDText = kOpaque_SkAlphaType == info.alphaType() ||
+ SkToBool(flags & kPreserveLCDText_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,
+ preserveLCDText, 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698