aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-01-16 08:06:32 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-16 13:28:43 +0000
commit0bd24dc41f2351d84f5fce32130668a5792d134b (patch)
treec46dc6fb7636fd7c2185e1f855f1dd582512fcc4 /gm
parent3167aa0c9c84cab1b0252031166e4a345e2afe2d (diff)
Funnel most proxy creation through GrProxyProvider
This is to provide a choke point for DDL to create Lazy Proxies. Change-Id: If178da13bc6447b31b7601810236d34502d9efbd Reviewed-on: https://skia-review.googlesource.com/93303 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'gm')
-rw-r--r--gm/flippity.cpp8
-rw-r--r--gm/texdata.cpp8
-rw-r--r--gm/texturedomaineffect.cpp10
-rw-r--r--gm/yuvtorgbeffect.cpp16
4 files changed, 22 insertions, 20 deletions
diff --git a/gm/flippity.cpp b/gm/flippity.cpp
index 93813b943f..bd9930c9df 100644
--- a/gm/flippity.cpp
+++ b/gm/flippity.cpp
@@ -13,6 +13,7 @@
#if SK_SUPPORT_GPU
#include "GrContextPriv.h"
+#include "GrProxyProvider.h"
#include "SkImage_Gpu.h"
static const int kNumMatrices = 6;
@@ -93,6 +94,7 @@ static SkColor swap_red_and_blue(SkColor c) {
static sk_sp<SkImage> make_reference_image(GrContext* context,
const SkTArray<sk_sp<SkImage>>& labels,
bool bottomLeftOrigin) {
+ GrProxyProvider* proxyProvider = context->contextPriv().proxyProvider();
SkASSERT(kNumLabels == labels.count());
SkImageInfo ii = SkImageInfo::Make(kImageSize, kImageSize,
@@ -130,10 +132,8 @@ static sk_sp<SkImage> make_reference_image(GrContext* context,
}
}
- sk_sp<GrTextureProxy> proxy = GrSurfaceProxy::MakeDeferred(
- context->contextPriv().proxyProvider(),
- desc, SkBudgeted::kYes,
- bm.getPixels(), bm.rowBytes());
+ sk_sp<GrTextureProxy> proxy = proxyProvider->createTextureProxy(desc, SkBudgeted::kYes,
+ bm.getPixels(), bm.rowBytes());
if (!proxy) {
return nullptr;
}
diff --git a/gm/texdata.cpp b/gm/texdata.cpp
index 4e44bccbdf..b4193a3423 100644
--- a/gm/texdata.cpp
+++ b/gm/texdata.cpp
@@ -12,6 +12,7 @@
#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "GrContextPriv.h"
+#include "GrProxyProvider.h"
#include "GrRenderTargetContext.h"
#include "GrTextureContext.h"
#include "GrFixedClip.h"
@@ -76,6 +77,7 @@ DEF_SIMPLE_GM_BG(texdata, canvas, 2 * S, 2 * S, SK_ColorBLACK) {
return;
}
+ GrProxyProvider* proxyProvider = context->contextPriv().proxyProvider();
const SkImageInfo ii = SkImageInfo::Make(S, S, kBGRA_8888_SkColorType, kPremul_SkAlphaType);
SkAutoTArray<SkPMColor> gTextureData((2 * S) * (2 * S));
@@ -91,10 +93,8 @@ DEF_SIMPLE_GM_BG(texdata, canvas, 2 * S, 2 * S, SK_ColorBLACK) {
desc.fHeight = 2 * S;
desc.fConfig = SkImageInfo2GrPixelConfig(ii, *context->caps());
- sk_sp<GrTextureProxy> proxy = GrSurfaceProxy::MakeDeferred(
- context->contextPriv().proxyProvider(),
- desc, SkBudgeted::kNo,
- gTextureData.get(), 0);
+ sk_sp<GrTextureProxy> proxy = proxyProvider->createTextureProxy(desc, SkBudgeted::kNo,
+ gTextureData.get(), 0);
if (!proxy) {
return;
}
diff --git a/gm/texturedomaineffect.cpp b/gm/texturedomaineffect.cpp
index 7ee28b1ffb..57f012973f 100644
--- a/gm/texturedomaineffect.cpp
+++ b/gm/texturedomaineffect.cpp
@@ -13,6 +13,7 @@
#include "GrContext.h"
#include "GrContextPriv.h"
+#include "GrProxyProvider.h"
#include "GrRenderTargetContextPriv.h"
#include "SkBitmap.h"
#include "SkGr.h"
@@ -86,17 +87,16 @@ protected:
return;
}
+ GrProxyProvider* proxyProvider = context->contextPriv().proxyProvider();
GrSurfaceDesc desc;
desc.fOrigin = kTopLeft_GrSurfaceOrigin;
desc.fWidth = fBmp.width();
desc.fHeight = fBmp.height();
desc.fConfig = SkImageInfo2GrPixelConfig(fBmp.info(), *context->caps());
- sk_sp<GrTextureProxy> proxy(GrSurfaceProxy::MakeDeferred(
- context->contextPriv().proxyProvider(),
- desc, SkBudgeted::kYes,
- fBmp.getPixels(),
- fBmp.rowBytes()));
+ sk_sp<GrTextureProxy> proxy = proxyProvider->createTextureProxy(desc, SkBudgeted::kYes,
+ fBmp.getPixels(),
+ fBmp.rowBytes());
if (!proxy) {
return;
}
diff --git a/gm/yuvtorgbeffect.cpp b/gm/yuvtorgbeffect.cpp
index ba27719e3b..e314ea28bc 100644
--- a/gm/yuvtorgbeffect.cpp
+++ b/gm/yuvtorgbeffect.cpp
@@ -13,6 +13,7 @@
#include "GrContext.h"
#include "GrContextPriv.h"
+#include "GrProxyProvider.h"
#include "GrRenderTargetContextPriv.h"
#include "GrTextureProxy.h"
#include "SkBitmap.h"
@@ -82,6 +83,7 @@ protected:
return;
}
+ GrProxyProvider* proxyProvider = context->contextPriv().proxyProvider();
sk_sp<GrTextureProxy> proxy[3];
{
@@ -93,9 +95,9 @@ protected:
desc.fHeight = fBmp[i].height();
desc.fConfig = SkImageInfo2GrPixelConfig(fBmp[i].info(), *context->caps());
- proxy[i] = GrSurfaceProxy::MakeDeferred(context->contextPriv().proxyProvider(),
- desc, SkBudgeted::kYes,
- fBmp[i].getPixels(), fBmp[i].rowBytes());
+ proxy[i] = proxyProvider->createTextureProxy(desc, SkBudgeted::kYes,
+ fBmp[i].getPixels(),
+ fBmp[i].rowBytes());
if (!proxy[i]) {
return;
}
@@ -210,6 +212,7 @@ protected:
return;
}
+ GrProxyProvider* proxyProvider = context->contextPriv().proxyProvider();
sk_sp<GrTextureProxy> proxy[3];
{
@@ -223,10 +226,9 @@ protected:
desc.fHeight = fBmp[index].height();
desc.fConfig = SkImageInfo2GrPixelConfig(fBmp[index].info(), *context->caps());
- proxy[i] = GrSurfaceProxy::MakeDeferred(context->contextPriv().proxyProvider(),
- desc, SkBudgeted::kYes,
- fBmp[index].getPixels(),
- fBmp[index].rowBytes());
+ proxy[i] = proxyProvider->createTextureProxy(desc, SkBudgeted::kYes,
+ fBmp[index].getPixels(),
+ fBmp[index].rowBytes());
if (!proxy[i]) {
return;
}