aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/SkGpuDevice.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-02-05 17:56:39 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-05 17:56:39 -0800
commitf1036b2c6610e106b299a1e2b69b814ff18b60f5 (patch)
tree47b85852c316af34a60f46665ab6fc7a27d40b51 /src/gpu/SkGpuDevice.cpp
parent3a2caf8ecf38124f4ad21a0f6c4dabfcfa17911a (diff)
Revert of skia: Add support for CHROMIUM_image backed textures. (patchset #17 id:340001 of https://codereview.chromium.org/1623653002/ )
Reason for revert: New unit test is failing on Windows ANGLE bots: http://build.chromium.org/p/client.skia/builders/Test-Win8-MSVC-ShuttleB-GPU-HD4600-x86_64-Release-ANGLE/builds/1866/steps/dm/logs/stdio Original issue's description: > skia: Add support for CHROMIUM_image backed textures. > > I created a new abstract base class TextureStorageAllocator that consumers of > Skia can subclass and pass back to Skia. When a surface is created with a > pointer to a TextureStorageAllocator, any textures it creates, or that are > derived from the original surface, will allocate and deallocate storage using > the methods on TextureStorageAllocator. > > BUG=https://code.google.com/p/chromium/issues/detail?id=579664 > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1623653002 > > Committed: https://skia.googlesource.com/skia/+/92098e691f10a010e7421125ba4d44c02506bb55 > > Committed: https://skia.googlesource.com/skia/+/7fec91ce6660190f8d7c5eb6f3061e4550cc672b TBR=bsalomon@chromium.org,cblume@chromium.org,robertphillips@google.com,egdaniel@google.com,reed@google.com,erikchen@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=https://code.google.com/p/chromium/issues/detail?id=579664 Review URL: https://codereview.chromium.org/1673923003
Diffstat (limited to 'src/gpu/SkGpuDevice.cpp')
-rw-r--r--src/gpu/SkGpuDevice.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 060b2a1e45..ed4ca74297 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -149,15 +149,13 @@ 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,
- GrTextureStorageAllocator customAllocator) {
+ const SkSurfaceProps* props, InitContents init) {
unsigned flags;
if (!CheckAlphaTypeAndGetFlags(&info, init, &flags)) {
return nullptr;
}
- SkAutoTUnref<GrRenderTarget> rt(CreateRenderTarget(
- context, budgeted, info, sampleCount, customAllocator));
+ SkAutoTUnref<GrRenderTarget> rt(CreateRenderTarget(context, budgeted, info, sampleCount));
if (nullptr == rt) {
return nullptr;
}
@@ -184,9 +182,8 @@ SkGpuDevice::SkGpuDevice(GrRenderTarget* rt, int width, int height,
}
}
-GrRenderTarget* SkGpuDevice::CreateRenderTarget(
- GrContext* context, SkSurface::Budgeted budgeted, const SkImageInfo& origInfo,
- int sampleCount, GrTextureStorageAllocator textureStorageAllocator) {
+GrRenderTarget* SkGpuDevice::CreateRenderTarget(GrContext* context, SkSurface::Budgeted budgeted,
+ const SkImageInfo& origInfo, int sampleCount) {
if (kUnknown_SkColorType == origInfo.colorType() ||
origInfo.width() < 0 || origInfo.height() < 0) {
return nullptr;
@@ -215,7 +212,6 @@ GrRenderTarget* SkGpuDevice::CreateRenderTarget(
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) {
@@ -326,8 +322,7 @@ void SkGpuDevice::replaceRenderTarget(bool shouldRetainContent) {
: SkSurface::kNo_Budgeted;
SkAutoTUnref<GrRenderTarget> newRT(CreateRenderTarget(
- this->context(), budgeted, this->imageInfo(), fRenderTarget->desc().fSampleCnt,
- fRenderTarget->desc().fTextureStorageAllocator));
+ this->context(), budgeted, this->imageInfo(), fRenderTarget->desc().fSampleCnt));
if (nullptr == newRT) {
return;
@@ -1479,7 +1474,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;