Lines Matching defs:src

8 #include "src/gpu/GrDataUtils.h"
12 #include "src/core/SkColorSpaceXformSteps.h"
13 #include "src/core/SkCompressedDataUtils.h"
14 #include "src/core/SkConvertPixels.h"
15 #include "src/core/SkMathPriv.h"
16 #include "src/core/SkMipmap.h"
17 #include "src/core/SkRasterPipeline.h"
18 #include "src/core/SkTLazy.h"
19 #include "src/core/SkTraceEvent.h"
20 #include "src/core/SkUtils.h"
21 #include "src/gpu/GrCaps.h"
22 #include "src/gpu/GrColor.h"
23 #include "src/gpu/GrImageInfo.h"
24 #include "src/gpu/GrPixmap.h"
25 #include "src/gpu/GrSwizzle.h"
571 bool GrConvertPixels(const GrPixmap& dst, const GrCPixmap& src, bool flipY) {
573 if (src.dimensions().isEmpty() || dst.dimensions().isEmpty()) {
576 if (src.colorType() == GrColorType::kUnknown || dst.colorType() == GrColorType::kUnknown) {
579 if (!src.hasPixels() || !dst.hasPixels()) {
582 if (dst.dimensions() != src.dimensions()) {
590 if (!GrConvertPixels(temp, src, flipY)) {
603 } else if (src.colorType() == GrColorType::kRGB_888) {
606 GrPixmap temp = GrPixmap::Allocate(src.info().makeColorType(GrColorType::kRGB_888x));
607 auto* sRow = reinterpret_cast<const char*>(src.addr());
609 for (int y = 0; y < src.height(); ++y, sRow += src.rowBytes(), tRow += temp.rowBytes()) {
610 for (int x = 0; x < src.width(); ++x) {
620 size_t srcBpp = src.info().bpp();
625 SkASSERT(src.rowBytes() % srcBpp == 0);
627 bool premul = src.alphaType() == kUnpremul_SkAlphaType &&
629 bool unpremul = src.alphaType() == kPremul_SkAlphaType &&
632 premul || unpremul || !SkColorSpace::Equals(src.colorSpace(), dst.colorSpace());
634 if (src.colorType() == dst.colorType() && !alphaOrCSConversion) {
637 auto s = static_cast<const char*>(src.addr());
639 for (int y = 0; y < dst.height(); ++y, d -= dst.rowBytes(), s += src.rowBytes()) {
644 src.addr(), src.rowBytes(),
645 tightRB, src.height());
653 auto loadSwizzle = get_load_and_src_swizzle(src.colorType(),
672 steps.init(src.colorSpace(), src.alphaType(), dst.colorSpace(), dst.alphaType());
681 int height = src.height();
683 srcCtx{const_cast<void*>(src.addr()), SkToInt(src.rowBytes()/srcBpp)},
687 // It *almost* works to point the src at the last row and negate the stride and run the
692 srcCtx.pixels = static_cast<char*>(srcCtx.pixels) + src.rowBytes()*(height - 1);
742 pipeline.run(0, 0, src.width(), height);
743 srcCtx.pixels = static_cast<char*>(srcCtx.pixels) - src.rowBytes();