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

Unified Diff: src/core/SkBitmapDevice.cpp

Issue 719253002: rename filterTextFlags to disableLCD (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rename disableLCD to shouldDisableLCD Created 6 years, 1 month 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/SkCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapDevice.cpp
diff --git a/src/core/SkBitmapDevice.cpp b/src/core/SkBitmapDevice.cpp
index 0c28feadfc3089955f7c635897a78d7d3f4d9836..5204fdb53e93476b00a56c295b09a451ac867dc0 100644
--- a/src/core/SkBitmapDevice.cpp
+++ b/src/core/SkBitmapDevice.cpp
@@ -7,6 +7,7 @@
#include "SkBitmapDevice.h"
#include "SkConfig8888.h"
+#include "SkDeviceProperties.h"
#include "SkDraw.h"
#include "SkRasterClip.h"
#include "SkShader.h"
@@ -61,14 +62,12 @@ SkBitmapDevice::SkBitmapDevice(const SkBitmap& bitmap) : fBitmap(bitmap) {
SkASSERT(valid_for_bitmap_device(bitmap.info(), NULL));
}
-#if 0
SkBitmapDevice::SkBitmapDevice(const SkBitmap& bitmap, const SkDeviceProperties& deviceProperties)
: SkBaseDevice(deviceProperties)
, fBitmap(bitmap)
{
SkASSERT(valid_for_bitmap_device(bitmap.info(), NULL));
}
-#endif
SkBitmapDevice* SkBitmapDevice::Create(const SkImageInfo& origInfo,
const SkDeviceProperties* props) {
@@ -93,8 +92,8 @@ SkBitmapDevice* SkBitmapDevice::Create(const SkImageInfo& origInfo,
}
}
- if (props && false) {
-// return SkNEW_ARGS(SkBitmapDevice, (bitmap, *props));
+ if (props) {
+ return SkNEW_ARGS(SkBitmapDevice, (bitmap, *props));
} else {
return SkNEW_ARGS(SkBitmapDevice, (bitmap));
}
@@ -112,7 +111,8 @@ void SkBitmapDevice::replaceBitmapBackendForRasterSurface(const SkBitmap& bm) {
}
SkBaseDevice* SkBitmapDevice::onCreateCompatibleDevice(const CreateInfo& cinfo) {
- return SkBitmapDevice::Create(cinfo.fInfo);// &this->getDeviceProperties());
+ SkDeviceProperties leaky(cinfo.fPixelGeometry);
+ return SkBitmapDevice::Create(cinfo.fInfo, &leaky);
}
void SkBitmapDevice::lockPixels() {
@@ -383,23 +383,15 @@ SkImageFilter::Cache* SkBitmapDevice::getImageFilterCache() {
///////////////////////////////////////////////////////////////////////////////
-bool SkBitmapDevice::filterTextFlags(const SkPaint& paint, TextFlags* flags) {
- if (!paint.isLCDRenderText() || !paint.isAntiAlias()) {
- // we're cool with the paint as is
- return false;
- }
-
+bool SkBitmapDevice::onShouldDisableLCD(const SkPaint& paint) const {
if (kN32_SkColorType != fBitmap.colorType() ||
paint.getRasterizer() ||
paint.getPathEffect() ||
paint.isFakeBoldText() ||
paint.getStyle() != SkPaint::kFill_Style ||
- !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode)) {
- // turn off lcd, but turn on kGenA8
- flags->fFlags = paint.getFlags() & ~SkPaint::kLCDRenderText_Flag;
- flags->fFlags |= SkPaint::kGenA8FromLCD_Flag;
+ !SkXfermode::IsMode(paint.getXfermode(), SkXfermode::kSrcOver_Mode))
+ {
return true;
}
- // we're cool with the paint as is
return false;
}
« no previous file with comments | « include/core/SkDevice.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698