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

Side by Side Diff: src/core/SkCanvas.cpp

Issue 718913003: Observe surface LCD settings in SkBaseDevice::drawTextBlob() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: adopting Mike's comment 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 unified diff | Download patch
« no previous file with comments | « include/core/SkDevice.h ('k') | src/core/SkDevice.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 2008 The Android Open Source Project 2 * Copyright 2008 The Android Open Source Project
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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkCanvasDrawable.h" 9 #include "SkCanvasDrawable.h"
10 #include "SkCanvasPriv.h" 10 #include "SkCanvasPriv.h"
(...skipping 2037 matching lines...) Expand 10 before | Expand all | Expand 10 after
2048 TRACE_EVENT0("skia", "SkCanvas::drawBitmapNine()"); 2048 TRACE_EVENT0("skia", "SkCanvas::drawBitmapNine()");
2049 SkDEBUGCODE(bitmap.validate();) 2049 SkDEBUGCODE(bitmap.validate();)
2050 2050
2051 // Need a device entry-point, so gpu can use a mesh 2051 // Need a device entry-point, so gpu can use a mesh
2052 this->internalDrawBitmapNine(bitmap, center, dst, paint); 2052 this->internalDrawBitmapNine(bitmap, center, dst, paint);
2053 } 2053 }
2054 2054
2055 class SkDeviceFilteredPaint { 2055 class SkDeviceFilteredPaint {
2056 public: 2056 public:
2057 SkDeviceFilteredPaint(SkBaseDevice* device, const SkPaint& paint) { 2057 SkDeviceFilteredPaint(SkBaseDevice* device, const SkPaint& paint) {
2058 if (device->shouldDisableLCD(paint)) { 2058 uint32_t filteredFlags = device->filterTextFlags(paint);
2059 uint32_t flags = paint.getFlags(); 2059 if (filteredFlags != paint.getFlags()) {
2060 flags &= ~SkPaint::kLCDRenderText_Flag;
2061 flags |= SkPaint::kGenA8FromLCD_Flag;
2062 SkPaint* newPaint = fLazy.set(paint); 2060 SkPaint* newPaint = fLazy.set(paint);
2063 newPaint->setFlags(flags); 2061 newPaint->setFlags(filteredFlags);
2064 fPaint = newPaint; 2062 fPaint = newPaint;
2065 } else { 2063 } else {
2066 fPaint = &paint; 2064 fPaint = &paint;
2067 } 2065 }
2068 } 2066 }
2069 2067
2070 const SkPaint& paint() const { return *fPaint; } 2068 const SkPaint& paint() const { return *fPaint; }
2071 2069
2072 private: 2070 private:
2073 const SkPaint* fPaint; 2071 const SkPaint* fPaint;
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
2586 } 2584 }
2587 2585
2588 if (matrix) { 2586 if (matrix) {
2589 canvas->concat(*matrix); 2587 canvas->concat(*matrix);
2590 } 2588 }
2591 } 2589 }
2592 2590
2593 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 2591 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
2594 fCanvas->restoreToCount(fSaveCount); 2592 fCanvas->restoreToCount(fSaveCount);
2595 } 2593 }
OLDNEW
« 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