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

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

Issue 2184443002: Fix F16 raster text masks. We don't want fake gamma in that case. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 months 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 | « no previous file | no next file » | 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 2006 The Android Open Source Project 2 * Copyright 2006 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 #define __STDC_LIMIT_MACROS 7 #define __STDC_LIMIT_MACROS
8 8
9 #include "SkDraw.h" 9 #include "SkDraw.h"
10 #include "SkBlitter.h" 10 #include "SkBlitter.h"
(...skipping 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after
1578 const SkRegion* const fClip; 1578 const SkRegion* const fClip;
1579 const SkDraw& fDraw; 1579 const SkDraw& fDraw;
1580 const SkPaint& fPaint; 1580 const SkPaint& fPaint;
1581 const SkIRect fClipBounds; 1581 const SkIRect fClipBounds;
1582 }; 1582 };
1583 1583
1584 //////////////////////////////////////////////////////////////////////////////// //////////////////// 1584 //////////////////////////////////////////////////////////////////////////////// ////////////////////
1585 1585
1586 uint32_t SkDraw::scalerContextFlags() const { 1586 uint32_t SkDraw::scalerContextFlags() const {
1587 uint32_t flags = SkPaint::kBoostContrast_ScalerContextFlag; 1587 uint32_t flags = SkPaint::kBoostContrast_ScalerContextFlag;
1588 // TODO: how should we handle non-srgb, non-linear gamma? 1588 if (!SkImageInfoIsGammaCorrect(fDevice->imageInfo())) {
1589 if (!fDevice->imageInfo().gammaCloseToSRGB()) {
1590 flags |= SkPaint::kFakeGamma_ScalerContextFlag; 1589 flags |= SkPaint::kFakeGamma_ScalerContextFlag;
1591 } 1590 }
1592 return flags; 1591 return flags;
1593 } 1592 }
1594 1593
1595 void SkDraw::drawText(const char text[], size_t byteLength, 1594 void SkDraw::drawText(const char text[], size_t byteLength,
1596 SkScalar x, SkScalar y, const SkPaint& paint) const { 1595 SkScalar x, SkScalar y, const SkPaint& paint) const {
1597 SkASSERT(byteLength == 0 || text != nullptr); 1596 SkASSERT(byteLength == 0 || text != nullptr);
1598 1597
1599 SkDEBUGCODE(this->validate();) 1598 SkDEBUGCODE(this->validate();)
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
2107 mask->fImage = SkMask::AllocImage(size); 2106 mask->fImage = SkMask::AllocImage(size);
2108 memset(mask->fImage, 0, mask->computeImageSize()); 2107 memset(mask->fImage, 0, mask->computeImageSize());
2109 } 2108 }
2110 2109
2111 if (SkMask::kJustComputeBounds_CreateMode != mode) { 2110 if (SkMask::kJustComputeBounds_CreateMode != mode) {
2112 draw_into_mask(*mask, devPath, style); 2111 draw_into_mask(*mask, devPath, style);
2113 } 2112 }
2114 2113
2115 return true; 2114 return true;
2116 } 2115 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698