mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Roll Skia to 7b971f0152299ae9a924252a9bfd220318497bdd
R=chinmaygarde@google.com Review URL: https://codereview.chromium.org/1236953002 .
This commit is contained in:
parent
41bdeb7602
commit
a68126d95d
@ -34,8 +34,8 @@
|
||||
namespace blink {
|
||||
|
||||
DecodingImageGenerator::DecodingImageGenerator(PassRefPtr<ImageFrameGenerator> frameGenerator, const SkImageInfo& info, size_t index)
|
||||
: m_frameGenerator(frameGenerator)
|
||||
, m_imageInfo(info)
|
||||
: SkImageGenerator(info)
|
||||
, m_frameGenerator(frameGenerator)
|
||||
, m_frameIndex(index)
|
||||
, m_generationId(0)
|
||||
{
|
||||
@ -58,24 +58,18 @@ SkData* DecodingImageGenerator::onRefEncodedData()
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool DecodingImageGenerator::onGetInfo(SkImageInfo* info)
|
||||
{
|
||||
*info = m_imageInfo;
|
||||
return true;
|
||||
}
|
||||
|
||||
SkImageGenerator::Result DecodingImageGenerator::onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, SkPMColor ctable[], int* ctableCount)
|
||||
SkImageGenerator::Result DecodingImageGenerator::onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, const Options& options, SkPMColor ctable[], int* ctableCount)
|
||||
{
|
||||
TRACE_EVENT1("blink", "DecodingImageGenerator::getPixels", "index", static_cast<int>(m_frameIndex));
|
||||
|
||||
// Implementation doesn't support scaling yet so make sure we're not given a different size.
|
||||
if (info.width() != m_imageInfo.width() || info.height() != m_imageInfo.height() || info.colorType() != m_imageInfo.colorType()) {
|
||||
if (info.width() != info.width() || info.height() != info.height() || info.colorType() != info.colorType()) {
|
||||
// ImageFrame may have changed the owning SkBitmap to kOpaque_SkAlphaType after sniffing the encoded data, so if we see a request
|
||||
// for opaque, that is ok even if our initial alphatype was not opaque.
|
||||
return Result::kInvalidScale;
|
||||
}
|
||||
|
||||
bool decoded = m_frameGenerator->decodeAndScale(m_imageInfo, m_frameIndex, pixels, rowBytes);
|
||||
bool decoded = m_frameGenerator->decodeAndScale(info, m_frameIndex, pixels, rowBytes);
|
||||
return decoded ? Result::kSuccess : Result::kInvalidInput;
|
||||
}
|
||||
|
||||
|
||||
@ -50,13 +50,11 @@ public:
|
||||
|
||||
protected:
|
||||
virtual SkData* onRefEncodedData() override;
|
||||
virtual bool onGetInfo(SkImageInfo*) override;
|
||||
virtual Result onGetPixels(const SkImageInfo&, void* pixels, size_t rowBytes, SkPMColor ctable[], int* ctableCount) override;
|
||||
virtual Result onGetPixels(const SkImageInfo&, void* pixels, size_t rowBytes, const Options& options, SkPMColor ctable[], int* ctableCount) override;
|
||||
virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3]) override;
|
||||
|
||||
private:
|
||||
RefPtr<ImageFrameGenerator> m_frameGenerator;
|
||||
SkImageInfo m_imageInfo;
|
||||
size_t m_frameIndex;
|
||||
size_t m_generationId;
|
||||
};
|
||||
|
||||
@ -481,17 +481,17 @@ void Path::translate(const FloatSize& size)
|
||||
|
||||
bool Path::subtractPath(const Path& other)
|
||||
{
|
||||
return Op(m_path, other.m_path, kDifference_PathOp, &m_path);
|
||||
return Op(m_path, other.m_path, kDifference_SkPathOp, &m_path);
|
||||
}
|
||||
|
||||
bool Path::intersectPath(const Path& other)
|
||||
{
|
||||
return Op(m_path, other.m_path, kIntersect_PathOp, &m_path);
|
||||
return Op(m_path, other.m_path, kIntersect_SkPathOp, &m_path);
|
||||
}
|
||||
|
||||
bool Path::unionPath(const Path& other)
|
||||
{
|
||||
return Op(m_path, other.m_path, kUnion_PathOp, &m_path);
|
||||
return Op(m_path, other.m_path, kUnion_SkPathOp, &m_path);
|
||||
}
|
||||
|
||||
#if ENABLE(ASSERT)
|
||||
|
||||
@ -42,12 +42,12 @@ bool ensureTextureBackedSkBitmap(GrContext* gr, SkBitmap& bitmap, const IntSize&
|
||||
return false;
|
||||
GrTextureDesc desc;
|
||||
desc.fConfig = config;
|
||||
desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagBit;
|
||||
desc.fFlags = kRenderTarget_GrSurfaceFlag;
|
||||
desc.fSampleCnt = 0;
|
||||
desc.fOrigin = origin;
|
||||
desc.fWidth = size.width();
|
||||
desc.fHeight = size.height();
|
||||
SkAutoTUnref<GrTexture> texture(gr->createUncachedTexture(desc, 0, 0));
|
||||
SkAutoTUnref<GrTexture> texture(gr->textureProvider()->createTexture(desc, false, 0, 0));
|
||||
if (!texture.get())
|
||||
return false;
|
||||
|
||||
|
||||
@ -147,7 +147,7 @@ bool SkPathContainsPoint(const SkPath& originalPath, const FloatPoint& point, Sk
|
||||
biggestCoord = std::max(std::max(biggestCoord, fX + 1), fY + 1);
|
||||
|
||||
const SkScalar kMaxCoordinate = SkIntToScalar(1 << 15);
|
||||
SkScalar scale = SkScalarDiv(kMaxCoordinate, biggestCoord);
|
||||
SkScalar scale = kMaxCoordinate / biggestCoord;
|
||||
|
||||
SkRegion rgn;
|
||||
SkRegion clip;
|
||||
|
||||
@ -20,7 +20,8 @@ GaneshSurface::GaneshSurface(intptr_t window_fbo,
|
||||
desc.fOrigin = kBottomLeft_GrSurfaceOrigin;
|
||||
desc.fRenderTargetHandle = window_fbo;
|
||||
|
||||
auto target = skia::AdoptRef(context->gr()->wrapBackendRenderTarget(desc));
|
||||
auto target = skia::AdoptRef(
|
||||
context->gr()->textureProvider()->wrapBackendRenderTarget(desc));
|
||||
DCHECK(target);
|
||||
surface_ = skia::AdoptRef(SkSurface::NewRenderTargetDirect(target.get()));
|
||||
DCHECK(surface_);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user