Remove code guarded by SK_LEGACY_SURFACE_PROPS.
This removes the last of the SkFontHost LCD globals and the SkSurfaceProps::kLegacyFontHost_InitType. Bug: skia:3934 Change-Id: Ic2342a3ea3dbcd075d6817cbd3fc27274e376b8d Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329364 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Mike Reed <reed@google.com>
This commit is contained in:
parent
58a26a8362
commit
9abf719e67
@ -9,6 +9,12 @@ Milestone 88
|
|||||||
|
|
||||||
* <insert new release notes here>
|
* <insert new release notes here>
|
||||||
|
|
||||||
|
* Removed SkSurfaceProps::kLegacyFontHost_InitType, SkFontLCDConfig, and related code.
|
||||||
|
The default pixel geometry for SkSurfaceProps is now kUnknown instead of kRGB_H.
|
||||||
|
The removal was guarded by the SK_LEGACY_SURFACE_PROPS build flag which was later removed.
|
||||||
|
https://review.skia.org/322490
|
||||||
|
https://review.skia.org/329364
|
||||||
|
|
||||||
* Legacy 8-bit YUV interface removed from SkImageGenerator. Use more flexible SkYUVAPixmaps-
|
* Legacy 8-bit YUV interface removed from SkImageGenerator. Use more flexible SkYUVAPixmaps-
|
||||||
based interface instead.
|
based interface instead.
|
||||||
https://review.skia.org/327917
|
https://review.skia.org/327917
|
||||||
|
@ -36,7 +36,6 @@ skia_core_public = [
|
|||||||
"$_include/core/SkFlattenable.h",
|
"$_include/core/SkFlattenable.h",
|
||||||
"$_include/core/SkFont.h",
|
"$_include/core/SkFont.h",
|
||||||
"$_include/core/SkFontArguments.h",
|
"$_include/core/SkFontArguments.h",
|
||||||
"$_include/core/SkFontLCDConfig.h",
|
|
||||||
"$_include/core/SkFontMetrics.h",
|
"$_include/core/SkFontMetrics.h",
|
||||||
"$_include/core/SkFontMgr.h",
|
"$_include/core/SkFontMgr.h",
|
||||||
"$_include/core/SkFontParameters.h",
|
"$_include/core/SkFontParameters.h",
|
||||||
@ -205,7 +204,6 @@ skia_core_sources = [
|
|||||||
"$_src/core/SkFont.cpp",
|
"$_src/core/SkFont.cpp",
|
||||||
"$_src/core/SkFontDescriptor.cpp",
|
"$_src/core/SkFontDescriptor.cpp",
|
||||||
"$_src/core/SkFontDescriptor.h",
|
"$_src/core/SkFontDescriptor.h",
|
||||||
"$_src/core/SkFontLCDConfig.cpp",
|
|
||||||
"$_src/core/SkFontMgr.cpp",
|
"$_src/core/SkFontMgr.cpp",
|
||||||
"$_src/core/SkFontMgrPriv.h",
|
"$_src/core/SkFontMgrPriv.h",
|
||||||
"$_src/core/SkFontPriv.h",
|
"$_src/core/SkFontPriv.h",
|
||||||
|
@ -1,60 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Google Inc.
|
|
||||||
*
|
|
||||||
* Use of this source code is governed by a BSD-style license that can be
|
|
||||||
* found in the LICENSE file.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SkFontLCDConfig_DEFINED
|
|
||||||
#define SkFontLCDConfig_DEFINED
|
|
||||||
|
|
||||||
#include "include/core/SkTypes.h"
|
|
||||||
|
|
||||||
#ifdef SK_LEGACY_SURFACE_PROPS
|
|
||||||
class SK_API SkFontLCDConfig {
|
|
||||||
public:
|
|
||||||
/** LCDs either have their color elements arranged horizontally or
|
|
||||||
vertically. When rendering subpixel glyphs we need to know which way
|
|
||||||
round they are.
|
|
||||||
|
|
||||||
Note, if you change this after startup, you'll need to flush the glyph
|
|
||||||
cache because it'll have the wrong type of masks cached.
|
|
||||||
|
|
||||||
@deprecated use SkPixelGeometry instead.
|
|
||||||
*/
|
|
||||||
enum LCDOrientation {
|
|
||||||
kHorizontal_LCDOrientation = 0, //!< this is the default
|
|
||||||
kVertical_LCDOrientation = 1,
|
|
||||||
};
|
|
||||||
|
|
||||||
/** @deprecated set on Device creation. */
|
|
||||||
static void SetSubpixelOrientation(LCDOrientation orientation);
|
|
||||||
/** @deprecated get from Device. */
|
|
||||||
static LCDOrientation GetSubpixelOrientation();
|
|
||||||
|
|
||||||
/** LCD color elements can vary in order. For subpixel text we need to know
|
|
||||||
the order which the LCDs uses so that the color fringes are in the
|
|
||||||
correct place.
|
|
||||||
|
|
||||||
Note, if you change this after startup, you'll need to flush the glyph
|
|
||||||
cache because it'll have the wrong type of masks cached.
|
|
||||||
|
|
||||||
kNONE_LCDOrder means that the subpixel elements are not spatially
|
|
||||||
separated in any usable fashion.
|
|
||||||
|
|
||||||
@deprecated use SkPixelGeometry instead.
|
|
||||||
*/
|
|
||||||
enum LCDOrder {
|
|
||||||
kRGB_LCDOrder = 0, //!< this is the default
|
|
||||||
kBGR_LCDOrder = 1,
|
|
||||||
kNONE_LCDOrder = 2,
|
|
||||||
};
|
|
||||||
|
|
||||||
/** @deprecated set on Device creation. */
|
|
||||||
static void SetSubpixelOrder(LCDOrder order);
|
|
||||||
/** @deprecated get from Device. */
|
|
||||||
static LCDOrder GetSubpixelOrder();
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
@ -56,18 +56,10 @@ public:
|
|||||||
/** Deprecated alias used by Chromium. Will be removed. */
|
/** Deprecated alias used by Chromium. Will be removed. */
|
||||||
static const Flags kUseDistanceFieldFonts_Flag = kUseDeviceIndependentFonts_Flag;
|
static const Flags kUseDistanceFieldFonts_Flag = kUseDeviceIndependentFonts_Flag;
|
||||||
|
|
||||||
#ifndef SK_LEGACY_SURFACE_PROPS
|
/** No flags, unknown pixel geometry. */
|
||||||
SkSurfaceProps();
|
SkSurfaceProps();
|
||||||
#endif
|
|
||||||
SkSurfaceProps(uint32_t flags, SkPixelGeometry);
|
SkSurfaceProps(uint32_t flags, SkPixelGeometry);
|
||||||
|
|
||||||
#ifdef SK_LEGACY_SURFACE_PROPS
|
|
||||||
enum InitType {
|
|
||||||
kLegacyFontHost_InitType
|
|
||||||
};
|
|
||||||
SkSurfaceProps(InitType);
|
|
||||||
SkSurfaceProps(uint32_t flags, InitType);
|
|
||||||
#endif
|
|
||||||
SkSurfaceProps(const SkSurfaceProps&);
|
SkSurfaceProps(const SkSurfaceProps&);
|
||||||
SkSurfaceProps& operator=(const SkSurfaceProps&);
|
SkSurfaceProps& operator=(const SkSurfaceProps&);
|
||||||
|
|
||||||
@ -85,11 +77,8 @@ public:
|
|||||||
bool operator!=(const SkSurfaceProps& that) const {
|
bool operator!=(const SkSurfaceProps& that) const {
|
||||||
return !(*this == that);
|
return !(*this == that);
|
||||||
}
|
}
|
||||||
private:
|
|
||||||
#ifdef SK_LEGACY_SURFACE_PROPS
|
|
||||||
SkSurfaceProps();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
private:
|
||||||
uint32_t fFlags;
|
uint32_t fFlags;
|
||||||
SkPixelGeometry fPixelGeometry;
|
SkPixelGeometry fPixelGeometry;
|
||||||
};
|
};
|
||||||
|
@ -213,11 +213,7 @@ static bool valid_for_bitmap_device(const SkImageInfo& info,
|
|||||||
}
|
}
|
||||||
|
|
||||||
SkBitmapDevice::SkBitmapDevice(const SkBitmap& bitmap)
|
SkBitmapDevice::SkBitmapDevice(const SkBitmap& bitmap)
|
||||||
#ifdef SK_LEGACY_SURFACE_PROPS
|
|
||||||
: INHERITED(bitmap.info(), SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType))
|
|
||||||
#else
|
|
||||||
: INHERITED(bitmap.info(), SkSurfaceProps())
|
: INHERITED(bitmap.info(), SkSurfaceProps())
|
||||||
#endif
|
|
||||||
, fBitmap(bitmap)
|
, fBitmap(bitmap)
|
||||||
, fRCStack(bitmap.width(), bitmap.height())
|
, fRCStack(bitmap.width(), bitmap.height())
|
||||||
, fGlyphPainter(this->surfaceProps(),
|
, fGlyphPainter(this->surfaceProps(),
|
||||||
@ -228,11 +224,7 @@ SkBitmapDevice::SkBitmapDevice(const SkBitmap& bitmap)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SkBitmapDevice* SkBitmapDevice::Create(const SkImageInfo& info) {
|
SkBitmapDevice* SkBitmapDevice::Create(const SkImageInfo& info) {
|
||||||
#ifdef SK_LEGACY_SURFACE_PROPS
|
|
||||||
return Create(info, SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType));
|
|
||||||
#else
|
|
||||||
return Create(info, SkSurfaceProps());
|
return Create(info, SkSurfaceProps());
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SkBitmapDevice::SkBitmapDevice(const SkBitmap& bitmap, const SkSurfaceProps& surfaceProps,
|
SkBitmapDevice::SkBitmapDevice(const SkBitmap& bitmap, const SkSurfaceProps& surfaceProps,
|
||||||
|
@ -515,14 +515,9 @@ void SkCanvas::init(sk_sp<SkBaseDevice> device) {
|
|||||||
|
|
||||||
SkCanvas::SkCanvas()
|
SkCanvas::SkCanvas()
|
||||||
: fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage))
|
: fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage))
|
||||||
#ifdef SK_LEGACY_SURFACE_PROPS
|
|
||||||
, fProps(SkSurfaceProps::kLegacyFontHost_InitType)
|
|
||||||
#else
|
|
||||||
, fProps()
|
, fProps()
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
inc_canvas();
|
inc_canvas();
|
||||||
|
|
||||||
this->init(nullptr);
|
this->init(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -537,11 +532,7 @@ SkCanvas::SkCanvas(int width, int height, const SkSurfaceProps* props)
|
|||||||
|
|
||||||
SkCanvas::SkCanvas(const SkIRect& bounds)
|
SkCanvas::SkCanvas(const SkIRect& bounds)
|
||||||
: fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage))
|
: fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage))
|
||||||
#ifdef SK_LEGACY_SURFACE_PROPS
|
|
||||||
, fProps(SkSurfaceProps::kLegacyFontHost_InitType)
|
|
||||||
#else
|
|
||||||
, fProps()
|
, fProps()
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
inc_canvas();
|
inc_canvas();
|
||||||
|
|
||||||
@ -571,11 +562,7 @@ SkCanvas::SkCanvas(const SkBitmap& bitmap, const SkSurfaceProps& props)
|
|||||||
SkCanvas::SkCanvas(const SkBitmap& bitmap, std::unique_ptr<SkRasterHandleAllocator> alloc,
|
SkCanvas::SkCanvas(const SkBitmap& bitmap, std::unique_ptr<SkRasterHandleAllocator> alloc,
|
||||||
SkRasterHandleAllocator::Handle hndl)
|
SkRasterHandleAllocator::Handle hndl)
|
||||||
: fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage))
|
: fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage))
|
||||||
#ifdef SK_LEGACY_SURFACE_PROPS
|
|
||||||
, fProps(SkSurfaceProps::kLegacyFontHost_InitType)
|
|
||||||
#else
|
|
||||||
, fProps()
|
, fProps()
|
||||||
#endif
|
|
||||||
, fAllocator(std::move(alloc))
|
, fAllocator(std::move(alloc))
|
||||||
{
|
{
|
||||||
inc_canvas();
|
inc_canvas();
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2009 The Android Open Source Project
|
|
||||||
*
|
|
||||||
* Use of this source code is governed by a BSD-style license that can be
|
|
||||||
* found in the LICENSE file.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "include/core/SkFontLCDConfig.h"
|
|
||||||
|
|
||||||
#ifdef SK_LEGACY_SURFACE_PROPS
|
|
||||||
static SkFontLCDConfig::LCDOrientation gLCDOrientation = SkFontLCDConfig::kHorizontal_LCDOrientation;
|
|
||||||
static SkFontLCDConfig::LCDOrder gLCDOrder = SkFontLCDConfig::kRGB_LCDOrder;
|
|
||||||
|
|
||||||
SkFontLCDConfig::LCDOrientation SkFontLCDConfig::GetSubpixelOrientation() {
|
|
||||||
return gLCDOrientation;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SkFontLCDConfig::SetSubpixelOrientation(LCDOrientation orientation) {
|
|
||||||
gLCDOrientation = orientation;
|
|
||||||
}
|
|
||||||
|
|
||||||
SkFontLCDConfig::LCDOrder SkFontLCDConfig::GetSubpixelOrder() {
|
|
||||||
return gLCDOrder;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SkFontLCDConfig::SetSubpixelOrder(LCDOrder order) {
|
|
||||||
gLCDOrder = order;
|
|
||||||
}
|
|
||||||
#endif
|
|
@ -316,11 +316,7 @@ public:
|
|||||||
SkScalerContextEffects* effects) {
|
SkScalerContextEffects* effects) {
|
||||||
SkPaint paint;
|
SkPaint paint;
|
||||||
return MakeRecAndEffects(
|
return MakeRecAndEffects(
|
||||||
#ifdef SK_LEGACY_SURFACE_PROPS
|
|
||||||
font, paint, SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType),
|
|
||||||
#else
|
|
||||||
font, paint, SkSurfaceProps(),
|
font, paint, SkSurfaceProps(),
|
||||||
#endif
|
|
||||||
SkScalerContextFlags::kNone, SkMatrix::I(), rec, effects);
|
SkScalerContextFlags::kNone, SkMatrix::I(), rec, effects);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,11 +102,7 @@ SkStrikeSpec SkStrikeSpec::MakeCanonicalized(const SkFont& font, const SkPaint*
|
|||||||
|
|
||||||
storage.commonSetup(*canonicalizedFont,
|
storage.commonSetup(*canonicalizedFont,
|
||||||
canonicalizedPaint,
|
canonicalizedPaint,
|
||||||
#ifdef SK_LEGACY_SURFACE_PROPS
|
|
||||||
SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType),
|
|
||||||
#else
|
|
||||||
SkSurfaceProps(),
|
SkSurfaceProps(),
|
||||||
#endif
|
|
||||||
kFakeGammaAndBoostContrast,
|
kFakeGammaAndBoostContrast,
|
||||||
SkMatrix::I());
|
SkMatrix::I());
|
||||||
return storage;
|
return storage;
|
||||||
@ -122,11 +118,7 @@ SkStrikeSpec SkStrikeSpec::MakeWithNoDevice(const SkFont& font, const SkPaint* p
|
|||||||
|
|
||||||
storage.commonSetup(font,
|
storage.commonSetup(font,
|
||||||
setupPaint,
|
setupPaint,
|
||||||
#ifdef SK_LEGACY_SURFACE_PROPS
|
|
||||||
SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType),
|
|
||||||
#else
|
|
||||||
SkSurfaceProps(),
|
SkSurfaceProps(),
|
||||||
#endif
|
|
||||||
kFakeGammaAndBoostContrast,
|
kFakeGammaAndBoostContrast,
|
||||||
SkMatrix::I());
|
SkMatrix::I());
|
||||||
|
|
||||||
|
@ -13,15 +13,7 @@
|
|||||||
struct SkImageInfo;
|
struct SkImageInfo;
|
||||||
|
|
||||||
static inline SkSurfaceProps SkSurfacePropsCopyOrDefault(const SkSurfaceProps* props) {
|
static inline SkSurfaceProps SkSurfacePropsCopyOrDefault(const SkSurfaceProps* props) {
|
||||||
if (props) {
|
return props ? *props : SkSurfaceProps();
|
||||||
return *props;
|
|
||||||
} else {
|
|
||||||
#ifdef SK_LEGACY_SURFACE_PROPS
|
|
||||||
return SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType);
|
|
||||||
#else
|
|
||||||
return SkSurfaceProps();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr size_t kIgnoreRowBytesValue = static_cast<size_t>(~0);
|
constexpr size_t kIgnoreRowBytesValue = static_cast<size_t>(~0);
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include "include/core/SkCanvas.h"
|
#include "include/core/SkCanvas.h"
|
||||||
#include "include/core/SkFontLCDConfig.h"
|
|
||||||
#include "include/gpu/GrBackendSurface.h"
|
#include "include/gpu/GrBackendSurface.h"
|
||||||
#include "src/core/SkAutoPixmapStorage.h"
|
#include "src/core/SkAutoPixmapStorage.h"
|
||||||
#include "src/core/SkImagePriv.h"
|
#include "src/core/SkImagePriv.h"
|
||||||
@ -17,39 +16,6 @@
|
|||||||
|
|
||||||
SkSurfaceProps::SkSurfaceProps() : fFlags(0), fPixelGeometry(kUnknown_SkPixelGeometry) {}
|
SkSurfaceProps::SkSurfaceProps() : fFlags(0), fPixelGeometry(kUnknown_SkPixelGeometry) {}
|
||||||
|
|
||||||
#ifdef SK_LEGACY_SURFACE_PROPS
|
|
||||||
static SkPixelGeometry compute_default_geometry() {
|
|
||||||
SkFontLCDConfig::LCDOrder order = SkFontLCDConfig::GetSubpixelOrder();
|
|
||||||
if (SkFontLCDConfig::kNONE_LCDOrder == order) {
|
|
||||||
return kUnknown_SkPixelGeometry;
|
|
||||||
} else {
|
|
||||||
// Bit0 is RGB(0), BGR(1)
|
|
||||||
// Bit1 is H(0), V(1)
|
|
||||||
const SkPixelGeometry gGeo[] = {
|
|
||||||
kRGB_H_SkPixelGeometry,
|
|
||||||
kBGR_H_SkPixelGeometry,
|
|
||||||
kRGB_V_SkPixelGeometry,
|
|
||||||
kBGR_V_SkPixelGeometry,
|
|
||||||
};
|
|
||||||
int index = 0;
|
|
||||||
if (SkFontLCDConfig::kBGR_LCDOrder == order) {
|
|
||||||
index |= 1;
|
|
||||||
}
|
|
||||||
if (SkFontLCDConfig::kVertical_LCDOrientation == SkFontLCDConfig::GetSubpixelOrientation()){
|
|
||||||
index |= 2;
|
|
||||||
}
|
|
||||||
return gGeo[index];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SkSurfaceProps::SkSurfaceProps(InitType) : fFlags(0), fPixelGeometry(compute_default_geometry()) {}
|
|
||||||
|
|
||||||
SkSurfaceProps::SkSurfaceProps(uint32_t flags, InitType)
|
|
||||||
: fFlags(flags)
|
|
||||||
, fPixelGeometry(compute_default_geometry())
|
|
||||||
{}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
SkSurfaceProps::SkSurfaceProps(uint32_t flags, SkPixelGeometry pg)
|
SkSurfaceProps::SkSurfaceProps(uint32_t flags, SkPixelGeometry pg)
|
||||||
: fFlags(flags), fPixelGeometry(pg)
|
: fFlags(flags), fPixelGeometry(pg)
|
||||||
{}
|
{}
|
||||||
|
Loading…
Reference in New Issue
Block a user