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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 1623653002: skia: Add support for CHROMIUM_image backed textures. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Add missing ')'. Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/SkGpuDevice.h ('k') | src/gpu/SkGrPixelRef.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index ed4ca7429753fb2045b9458f3a0f4d360eb7332d..060b2a1e45dec890f506de0ebb39a1f472ae156e 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -149,13 +149,15 @@ SkGpuDevice* SkGpuDevice::Create(GrRenderTarget* rt, int width, int height,
SkGpuDevice* SkGpuDevice::Create(GrContext* context, SkSurface::Budgeted budgeted,
const SkImageInfo& info, int sampleCount,
- const SkSurfaceProps* props, InitContents init) {
+ const SkSurfaceProps* props, InitContents init,
+ GrTextureStorageAllocator customAllocator) {
unsigned flags;
if (!CheckAlphaTypeAndGetFlags(&info, init, &flags)) {
return nullptr;
}
- SkAutoTUnref<GrRenderTarget> rt(CreateRenderTarget(context, budgeted, info, sampleCount));
+ SkAutoTUnref<GrRenderTarget> rt(CreateRenderTarget(
+ context, budgeted, info, sampleCount, customAllocator));
if (nullptr == rt) {
return nullptr;
}
@@ -182,8 +184,9 @@ SkGpuDevice::SkGpuDevice(GrRenderTarget* rt, int width, int height,
}
}
-GrRenderTarget* SkGpuDevice::CreateRenderTarget(GrContext* context, SkSurface::Budgeted budgeted,
- const SkImageInfo& origInfo, int sampleCount) {
+GrRenderTarget* SkGpuDevice::CreateRenderTarget(
+ GrContext* context, SkSurface::Budgeted budgeted, const SkImageInfo& origInfo,
+ int sampleCount, GrTextureStorageAllocator textureStorageAllocator) {
if (kUnknown_SkColorType == origInfo.colorType() ||
origInfo.width() < 0 || origInfo.height() < 0) {
return nullptr;
@@ -212,6 +215,7 @@ GrRenderTarget* SkGpuDevice::CreateRenderTarget(GrContext* context, SkSurface::B
desc.fHeight = info.height();
desc.fConfig = SkImageInfo2GrPixelConfig(info);
desc.fSampleCnt = sampleCount;
+ desc.fTextureStorageAllocator = textureStorageAllocator;
GrTexture* texture = context->textureProvider()->createTexture(
desc, SkToBool(budgeted), nullptr, 0);
if (nullptr == texture) {
@@ -322,7 +326,8 @@ void SkGpuDevice::replaceRenderTarget(bool shouldRetainContent) {
: SkSurface::kNo_Budgeted;
SkAutoTUnref<GrRenderTarget> newRT(CreateRenderTarget(
- this->context(), budgeted, this->imageInfo(), fRenderTarget->desc().fSampleCnt));
+ this->context(), budgeted, this->imageInfo(), fRenderTarget->desc().fSampleCnt,
+ fRenderTarget->desc().fTextureStorageAllocator));
if (nullptr == newRT) {
return;
@@ -1474,7 +1479,7 @@ void SkGpuDevice::drawProducerNine(const SkDraw& draw, GrTextureProducer* produc
SkRect srcR, dstR;
while (iter.next(&srcR, &dstR)) {
- this->drawTextureProducer(producer, &srcR, &dstR, SkCanvas::kStrict_SrcRectConstraint,
+ this->drawTextureProducer(producer, &srcR, &dstR, SkCanvas::kStrict_SrcRectConstraint,
*draw.fMatrix, fClip, paint);
}
return;
« no previous file with comments | « src/gpu/SkGpuDevice.h ('k') | src/gpu/SkGrPixelRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698