aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2016-11-15 22:17:22 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-15 22:17:40 +0000
commit4e344c8b93c7c2d1ef3cb7fd339bba55c479ece0 (patch)
tree73aade9f0896ae2b413ca495b132e486e8bf5949 /src/gpu
parentbe42c994b41a6d99b4bbf370aa1634350c773219 (diff)
Revert "Defer more renderTargetContexts in the GPU image filter paths"
This reverts commit fd01ce05ef7902c49b0272b3524a389693c72b35. Reason for revert: see if this is the cause of the Nexus7 assertion failure Original change's description: > Defer more renderTargetContexts in the GPU image filter paths > > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4767 > > Change-Id: I4c1f27247ef340a49d1ac96761810e77e6047ca2 > Reviewed-on: https://skia-review.googlesource.com/4767 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Robert Phillips <robertphillips@google.com> > TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I158f96ec1252481345fc5dca15086ffd4b47cb95 Reviewed-on: https://skia-review.googlesource.com/4875 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrBlurUtils.cpp38
-rw-r--r--src/gpu/GrContext.cpp17
2 files changed, 18 insertions, 37 deletions
diff --git a/src/gpu/GrBlurUtils.cpp b/src/gpu/GrBlurUtils.cpp
index d31a7a7fba..58d12af178 100644
--- a/src/gpu/GrBlurUtils.cpp
+++ b/src/gpu/GrBlurUtils.cpp
@@ -13,7 +13,6 @@
#include "effects/GrSimpleTextureEffect.h"
#include "GrStyle.h"
#include "GrTexture.h"
-#include "GrTextureProxy.h"
#include "GrTextureProvider.h"
#include "SkDraw.h"
#include "SkGrPriv.h"
@@ -93,25 +92,25 @@ static bool sw_draw_with_mask_filter(GrRenderTargetContext* renderTargetContext,
}
// Create a mask of 'devPath' and place the result in 'mask'.
-static sk_sp<GrTextureProxy> create_mask_GPU(GrContext* context,
- const SkIRect& maskRect,
- const SkPath& devPath,
- SkStrokeRec::InitStyle fillOrHairline,
- bool doAA,
- int sampleCnt) {
+static sk_sp<GrTexture> create_mask_GPU(GrContext* context,
+ const SkIRect& maskRect,
+ const SkPath& devPath,
+ SkStrokeRec::InitStyle fillOrHairline,
+ bool doAA,
+ int sampleCnt) {
if (!doAA) {
// Don't need MSAA if mask isn't AA
sampleCnt = 0;
}
- sk_sp<GrRenderTargetContext> rtContext(context->makeDeferredRenderTargetContextWithFallback(
+ sk_sp<GrRenderTargetContext> renderTargetContext(context->makeRenderTargetContextWithFallback(
SkBackingFit::kApprox, maskRect.width(), maskRect.height(), kAlpha_8_GrPixelConfig, nullptr,
sampleCnt));
- if (!rtContext) {
+ if (!renderTargetContext) {
return nullptr;
}
- rtContext->clear(nullptr, 0x0, true);
+ renderTargetContext->clear(nullptr, 0x0, true);
GrPaint tempPaint;
tempPaint.setAntiAlias(doAA);
@@ -125,8 +124,8 @@ static sk_sp<GrTextureProxy> create_mask_GPU(GrContext* context,
// the origin using tempPaint.
SkMatrix translate;
translate.setTranslate(-SkIntToScalar(maskRect.fLeft), -SkIntToScalar(maskRect.fTop));
- rtContext->drawPath(clip, tempPaint, translate, devPath, GrStyle(fillOrHairline));
- return sk_ref_sp(rtContext->asDeferredTexture());
+ renderTargetContext->drawPath(clip, tempPaint, translate, devPath, GrStyle(fillOrHairline));
+ return renderTargetContext->asTexture();;
}
static void draw_path_with_mask_filter(GrContext* context,
@@ -205,17 +204,16 @@ static void draw_path_with_mask_filter(GrContext* context,
return;
}
- sk_sp<GrTextureProxy> mask(create_mask_GPU(context,
- finalIRect,
- *path,
- fillOrHairline,
- paint->isAntiAlias(),
- renderTargetContext->numColorSamples()));
+ sk_sp<GrTexture> mask(create_mask_GPU(context,
+ finalIRect,
+ *path,
+ fillOrHairline,
+ paint->isAntiAlias(),
+ renderTargetContext->numColorSamples()));
if (mask) {
GrTexture* filtered;
- if (maskFilter->filterMaskGPU(mask->instantiate(context->textureProvider()),
- viewMatrix, finalIRect, &filtered)) {
+ if (maskFilter->filterMaskGPU(mask.get(), viewMatrix, finalIRect, &filtered)) {
// filterMaskGPU gives us ownership of a ref to the result
sk_sp<GrTexture> atu(filtered);
if (draw_mask(renderTargetContext, clip, viewMatrix, finalIRect, paint, filtered)) {
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index d7c66a0b5d..71203d6442 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -744,23 +744,6 @@ sk_sp<GrRenderTargetContext> GrContext::makeRenderTargetContextWithFallback(
sampleCnt, origin, surfaceProps, budgeted);
}
-sk_sp<GrRenderTargetContext> GrContext::makeDeferredRenderTargetContextWithFallback(
- SkBackingFit fit,
- int width, int height,
- GrPixelConfig config,
- sk_sp<SkColorSpace> colorSpace,
- int sampleCnt,
- GrSurfaceOrigin origin,
- const SkSurfaceProps* surfaceProps,
- SkBudgeted budgeted) {
- if (!this->caps()->isConfigRenderable(config, sampleCnt > 0)) {
- config = GrPixelConfigFallback(config);
- }
-
- return this->makeDeferredRenderTargetContext(fit, width, height, config, std::move(colorSpace),
- sampleCnt, origin, surfaceProps, budgeted);
-}
-
sk_sp<GrRenderTargetContext> GrContext::makeRenderTargetContext(SkBackingFit fit,
int width, int height,
GrPixelConfig config,