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

Side by Side Diff: src/core/SkDevice.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 unified diff | Download patch
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
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 #include "SkColorFilter.h" 8 #include "SkColorFilter.h"
9 #include "SkDevice.h" 9 #include "SkDevice.h"
10 #include "SkDraw.h" 10 #include "SkDraw.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 const SkBitmap& SkBaseDevice::accessBitmap(bool changePixels) { 48 const SkBitmap& SkBaseDevice::accessBitmap(bool changePixels) {
49 const SkBitmap& bitmap = this->onAccessBitmap(); 49 const SkBitmap& bitmap = this->onAccessBitmap();
50 if (changePixels) { 50 if (changePixels) {
51 bitmap.notifyPixelsChanged(); 51 bitmap.notifyPixelsChanged();
52 } 52 }
53 return bitmap; 53 return bitmap;
54 } 54 }
55 55
56 SkPixelGeometry SkBaseDevice::CreateInfo::AdjustGeometry(const SkImageInfo& info , 56 SkPixelGeometry SkBaseDevice::CreateInfo::AdjustGeometry(const SkImageInfo& info ,
57 TileUsage tileUsage, 57 TileUsage tileUsage,
58 SkPixelGeometry geo) { 58 SkPixelGeometry geo,
59 bool preserveLCDText) {
59 switch (tileUsage) { 60 switch (tileUsage) {
60 case kPossible_TileUsage: 61 case kPossible_TileUsage:
61 // (we think) for compatibility with old clients, we assume this lay er can support LCD 62 // (we think) for compatibility with old clients, we assume this lay er can support LCD
62 // even though they may not have marked it as opaque... seems like w e should update 63 // even though they may not have marked it as opaque... seems like w e should update
63 // our callers (reed/robertphilips). 64 // our callers (reed/robertphilips).
64 break; 65 break;
65 case kNever_TileUsage: 66 case kNever_TileUsage:
66 if (info.alphaType() != kOpaque_SkAlphaType) { 67 if (!preserveLCDText) {
67 geo = kUnknown_SkPixelGeometry; 68 geo = kUnknown_SkPixelGeometry;
68 } 69 }
69 break; 70 break;
70 } 71 }
71 return geo; 72 return geo;
72 } 73 }
73 74
74 void SkBaseDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer, 75 void SkBaseDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer,
75 const SkRRect& inner, const SkPaint& paint) { 76 const SkRRect& inner, const SkPaint& paint) {
76 SkPath path; 77 SkPath path;
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 if (kUnknown_SkPixelGeometry == fSurfaceProps.pixelGeometry() 440 if (kUnknown_SkPixelGeometry == fSurfaceProps.pixelGeometry()
440 || this->onShouldDisableLCD(paint)) { 441 || this->onShouldDisableLCD(paint)) {
441 442
442 flags &= ~SkPaint::kLCDRenderText_Flag; 443 flags &= ~SkPaint::kLCDRenderText_Flag;
443 flags |= SkPaint::kGenA8FromLCD_Flag; 444 flags |= SkPaint::kGenA8FromLCD_Flag;
444 } 445 }
445 446
446 return flags; 447 return flags;
447 } 448 }
448 449
OLDNEW
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698