Update sprint to graphite name

Change-Id: Ice0826af0b64fa8dd92975f879af8ab0f71740fc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/451039
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Robert Phillips 2021-09-21 11:59:57 -04:00 committed by SkCQ
parent 8abb52f212
commit 755e00edec
13 changed files with 61 additions and 58 deletions

View File

@ -1025,11 +1025,11 @@ optional("ndk_images") {
libs = [ "jnigraphics" ]
}
optional("tbd") {
enabled = skia_enable_tbd
public_defines = [ "SK_TBD_ENABLED" ]
public = skia_tbd_public
sources = skia_tbd_sources
optional("graphite") {
enabled = skia_enable_graphite
public_defines = [ "SK_GRAPHITE_ENABLED" ]
public = skia_graphite_public
sources = skia_graphite_sources
}
optional("pdf") {
@ -1211,9 +1211,9 @@ skia_component("skia") {
":fontmgr_win",
":fontmgr_win_gdi",
":gpu",
":graphite",
":pdf",
":skcms",
":tbd",
":xps",
]

View File

@ -79,8 +79,8 @@
#include "src/xml/SkXMLWriter.h"
#endif
#ifdef SK_TBD_ENABLED
#include "experimental/sktbd/include/SkStuff.h"
#ifdef SK_GRAPHITE_ENABLED
#include "experimental/graphite/include/SkStuff.h"
#endif
#if defined(SK_ENABLE_ANDROID_UTILS)
@ -2114,14 +2114,17 @@ Result RasterSink::draw(const Src& src, SkBitmap* dst, SkWStream*, SkString*) co
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
TBDSink::TBDSink() {}
GraphiteSink::GraphiteSink() {}
#ifdef SK_TBD_ENABLED
#ifdef SK_GRAPHITE_ENABLED
Result TBDSink::draw(const Src& src, SkBitmap* dst, SkWStream* dstStream, SkString* log) const {
Result GraphiteSink::draw(const Src& src,
SkBitmap* dst,
SkWStream* dstStream,
SkString* log) const {
SkImageInfo ii = SkImageInfo::Make(src.size(), kRGBA_8888_SkColorType, kPremul_SkAlphaType);
sk_sp<SkSurface> surface = MakeTBD(ii);
sk_sp<SkSurface> surface = MakeGraphite(ii);
if (!surface) {
return Result::Fatal("Could not create a surface.");
}
@ -2137,8 +2140,8 @@ Result TBDSink::draw(const Src& src, SkBitmap* dst, SkWStream* dstStream, SkStri
return Result::Ok();
}
#else
Result TBDSink::draw(const Src& src, SkBitmap*, SkWStream* dst, SkString*) const {
return Result::Fatal("TBD not enabled.");
Result GraphiteSink::draw(const Src& src, SkBitmap*, SkWStream* dst, SkString*) const {
return Result::Fatal("Graphite not enabled.");
}
#endif

View File

@ -579,12 +579,12 @@ private:
int fPageIndex;
};
class TBDSink : public Sink {
class GraphiteSink : public Sink {
public:
TBDSink();
GraphiteSink();
Result draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
const char* fileExtension() const override { return "tbd"; }
const char* fileExtension() const override { return "gr"; }
SinkFlags flags() const override { return SinkFlags{ SinkFlags::kVector, SinkFlags::kDirect }; }
};

View File

@ -8,7 +8,7 @@
#ifndef Context_DEFINED
#define Context_DEFINED
namespace sktbd {
namespace skgpu {
class Context {
public:
@ -16,7 +16,7 @@ public:
private:
};
} // namespace sktbd
} // namespace skgpu
#endif // Context_DEFINED

View File

@ -14,6 +14,6 @@ struct SkImageInfo;
class SkSurface;
// TODO: Should be SkSurface.h
sk_sp<SkSurface> MakeTBD(const SkImageInfo&);
sk_sp<SkSurface> MakeGraphite(const SkImageInfo&);
#endif // SkStuff_DEFINED

View File

@ -5,10 +5,10 @@
* found in the LICENSE file.
*/
#include "experimental/sktbd/include/Context.h"
#include "experimental/graphite/include/Context.h"
namespace sktbd {
namespace skgpu {
Context::Context() {}
} // namespace sktbd
} // namespace skgpu

View File

@ -5,12 +5,12 @@
* found in the LICENSE file.
*/
#include "experimental/sktbd/src/Device.h"
#include "experimental/graphite/src/Device.h"
#include "include/core/SkImageInfo.h"
namespace sktbd {
namespace skgpu {
Device::Device(const SkImageInfo& ii) : SkBaseDevice(ii, SkSurfaceProps()) {}
} // namespace sktbd
} // namespace skgpu

View File

@ -10,7 +10,7 @@
#include "src/core/SkDevice.h"
namespace sktbd {
namespace skgpu {
class Device final : public SkBaseDevice {
public:
@ -43,6 +43,6 @@ protected:
private:
};
} // namespace sktbd
} // namespace skgpu
#endif // Device_DEFINED

View File

@ -0,0 +1,23 @@
/*
* Copyright 2021 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "experimental/graphite/include/SkStuff.h"
#include "experimental/graphite/src/Device.h"
sk_sp<SkSurface> MakeGraphite(const SkImageInfo& ii) {
sk_sp<skgpu::Device> device = sk_make_sp<skgpu::Device>(ii);
if (!device) {
return nullptr;
}
// TODO: create a new SkSurface_Graphite class that wraps a skgpu::Device.
// skgpu::BaseDevice carries a lot of baggage.
//return sk_make_sp<SkSurface_Graphite>(std::move(device));
return nullptr;
}

View File

@ -1,23 +0,0 @@
/*
* Copyright 2021 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "experimental/sktbd/include/SkStuff.h"
#include "experimental/sktbd/src/Device.h"
sk_sp<SkSurface> MakeTBD(const SkImageInfo& ii) {
sk_sp<sktbd::Device> device = sk_make_sp<sktbd::Device>(ii);
if (!device) {
return nullptr;
}
// TODO: create a new SkSurface_TBD class that wraps a sktbd::Device. skgpu::BaseDevice
// carries a lot of baggage.
//return sk_make_sp<SkSurface_TBD>(std::move(device));
return nullptr;
}

View File

@ -4,16 +4,16 @@
# found in the LICENSE file.
# Things are easiest for everyone if these source paths are absolute.
_src = get_path_info("../experimental/sktbd/src", "abspath")
_include = get_path_info("../experimental/sktbd/include", "abspath")
_src = get_path_info("../experimental/graphite/src", "abspath")
_include = get_path_info("../experimental/graphite/include", "abspath")
skia_tbd_public = [ "$_include/Context.h" ]
skia_graphite_public = [ "$_include/Context.h" ]
skia_tbd_sources = [
skia_graphite_sources = [
"$_include/Context.h",
"$_include/SkStuff.h",
"$_src/Context.cpp",
"$_src/Device.cpp",
"$_src/Device.h",
"$_src/SkStuff.cpp",
"$_src/SkStuff.h",
]

View File

@ -7,10 +7,10 @@ import("core.gni")
import("effects.gni")
import("effects_imagefilters.gni")
import("gpu.gni")
import("graphite.gni")
import("opts.gni")
import("pdf.gni")
import("sksl.gni")
import("sktbd.gni")
import("utils.gni")
import("xps.gni")

View File

@ -68,7 +68,7 @@ declare_args() {
skia_use_wuffs = false
skia_use_x11 = is_linux
skia_use_xps = true
skia_enable_tbd = false
skia_enable_graphite = false
skia_use_zlib = true
skia_vtune_path = ""