GrRenderTargetContext->GrSurfaceDrawContext
Just the class/files. variable names and additional comments to follow. Change-Id: Ic03d07fd5009eaf3d706c2536486a117328963fc Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342617 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
This commit is contained in:
parent
2c98edf07f
commit
eebe735dea
@ -12,7 +12,7 @@
|
||||
#include "include/gpu/GrDirectContext.h"
|
||||
#include "include/utils/SkRandom.h"
|
||||
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/SkGr.h"
|
||||
|
||||
// Benchmarks that exercise the bulk image and solid color quad APIs, under a variety of patterns:
|
||||
@ -49,7 +49,7 @@ public:
|
||||
|
||||
bool isSuitableFor(Backend backend) override {
|
||||
if (kDrawMode == DrawMode::kBatch && kImageMode == ImageMode::kNone) {
|
||||
// Currently the bulk color quad API is only available on GrRenderTargetContext
|
||||
// Currently the bulk color quad API is only available on GrSurfaceDrawContext
|
||||
return backend == kGPU_Backend;
|
||||
} else {
|
||||
return this->INHERITED::isSuitableFor(backend);
|
||||
@ -132,7 +132,7 @@ protected:
|
||||
auto context = canvas->recordingContext();
|
||||
SkASSERT(context);
|
||||
|
||||
GrRenderTargetContext::QuadSetEntry batch[kRectCount];
|
||||
GrSurfaceDrawContext::QuadSetEntry batch[kRectCount];
|
||||
for (int i = 0; i < kRectCount; ++i) {
|
||||
batch[i].fRect = fRects[i];
|
||||
batch[i].fColor = fColors[i].premul();
|
||||
@ -144,7 +144,7 @@ protected:
|
||||
paint.setColor(SK_ColorWHITE);
|
||||
paint.setAntiAlias(true);
|
||||
|
||||
GrRenderTargetContext* rtc = canvas->internal_private_accessTopLayerRenderTargetContext();
|
||||
GrSurfaceDrawContext* rtc = canvas->internal_private_accessTopLayerRenderTargetContext();
|
||||
SkMatrix view = canvas->getLocalToDeviceAs3x3();
|
||||
SkSimpleMatrixProvider matrixProvider(view);
|
||||
GrPaint grPaint;
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "include/core/SkRect.h"
|
||||
#include "include/effects/SkGradientShader.h"
|
||||
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
|
||||
static sk_sp<SkShader> make_shader() {
|
||||
static const SkPoint kPts[] = {{0, 0}, {10, 10}};
|
||||
@ -62,9 +62,9 @@ protected:
|
||||
SkPaint interruptPaint;
|
||||
interruptPaint.setShader(make_shader());
|
||||
|
||||
GrRenderTargetContext* rtc = canvas->internal_private_accessTopLayerRenderTargetContext();
|
||||
GrSurfaceDrawContext* rtc = canvas->internal_private_accessTopLayerRenderTargetContext();
|
||||
if (rtc) {
|
||||
// Tell the GrRenderTargetContext to not reset its draw op list on a fullscreen clear.
|
||||
// Tell the GrSurfaceDrawContext to not reset its draw op list on a fullscreen clear.
|
||||
// If we don't do this, fullscreen clear ops would be created and constantly discard the
|
||||
// previous iteration's op so execution would only invoke one actual clear on the GPU
|
||||
// (not what we want to measure).
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "include/gpu/GrRecordingContext.h"
|
||||
#include "src/core/SkUtils.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/SkGr.h"
|
||||
#include "src/gpu/text/GrTextBlob.h"
|
||||
#include "src/utils/SkUTF.h"
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "src/gpu/GrGeometryProcessor.h"
|
||||
#include "src/gpu/GrMemoryPool.h"
|
||||
#include "src/gpu/GrProgramInfo.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/SkGr.h"
|
||||
#include "src/gpu/glsl/GrGLSLColorSpaceXformHelper.h"
|
||||
#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
|
||||
@ -308,7 +308,7 @@ public:
|
||||
const int kDrawsPerLoop = 32;
|
||||
|
||||
for (int i = 0; i < loops; ++i) {
|
||||
auto rtc = GrRenderTargetContext::Make(
|
||||
auto rtc = GrSurfaceDrawContext::Make(
|
||||
context, GrColorType::kRGBA_8888, p3, SkBackingFit::kApprox, {100, 100});
|
||||
SkASSERT(rtc);
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include "src/gpu/GrProcessorSet.h"
|
||||
#include "src/gpu/GrProgramInfo.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrUserStencilSettings.h"
|
||||
#include "src/gpu/effects/GrBezierEffect.h"
|
||||
#include "src/gpu/effects/GrPorterDuffXferProcessor.h"
|
||||
@ -226,7 +226,7 @@ protected:
|
||||
return SkISize::Make(kCellWidth, kNumConics*kCellHeight);
|
||||
}
|
||||
|
||||
void onDraw(GrRecordingContext* context, GrRenderTargetContext* renderTargetContext,
|
||||
void onDraw(GrRecordingContext* context, GrSurfaceDrawContext* renderTargetContext,
|
||||
SkCanvas* canvas) override {
|
||||
|
||||
const SkScalar w = kCellWidth, h = kCellHeight;
|
||||
@ -426,7 +426,7 @@ protected:
|
||||
return SkISize::Make(kCellWidth, kNumQuads*kCellHeight);
|
||||
}
|
||||
|
||||
void onDraw(GrRecordingContext* context, GrRenderTargetContext* renderTargetContext,
|
||||
void onDraw(GrRecordingContext* context, GrSurfaceDrawContext* renderTargetContext,
|
||||
SkCanvas* canvas) override {
|
||||
|
||||
const SkScalar w = kCellWidth, h = kCellHeight;
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "src/gpu/GrCaps.h"
|
||||
#include "src/gpu/GrFragmentProcessor.h"
|
||||
#include "src/gpu/GrPaint.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/effects/GrPorterDuffXferProcessor.h"
|
||||
#include "src/gpu/effects/GrRRectEffect.h"
|
||||
#include "src/gpu/ops/GrDrawOp.h"
|
||||
@ -65,7 +65,7 @@ protected:
|
||||
|
||||
SkISize onISize() override { return SkISize::Make(fWidth, fHeight); }
|
||||
|
||||
void onDraw(GrRecordingContext* context, GrRenderTargetContext* renderTargetContext,
|
||||
void onDraw(GrRecordingContext* context, GrSurfaceDrawContext* renderTargetContext,
|
||||
SkCanvas* canvas) override {
|
||||
SkPaint paint;
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "include/gpu/GrDirectContext.h"
|
||||
#include "include/gpu/GrRecordingContext.h"
|
||||
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
|
||||
// This test exercises Ganesh's drawing of tiled bitmaps. In particular, that the offsets and the
|
||||
// extents of the tiles don't causes gaps between tiles.
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "include/core/SkPoint.h"
|
||||
#include "include/core/SkRect.h"
|
||||
#include "include/private/SkColorData.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrSwizzle.h"
|
||||
|
||||
// Size of each clear
|
||||
@ -23,19 +23,19 @@ DEF_SIMPLE_GPU_GM(clear_swizzle, ctx, rtCtx, canvas, 6*kSize, 2*kSize) {
|
||||
auto make_offscreen = [&](const SkISize dimensions) {
|
||||
GrSwizzle readSwizzle = GrSwizzle::Concat(rtCtx->readSwizzle(), GrSwizzle{"bgra"});
|
||||
GrSwizzle writeSwizzle = GrSwizzle::Concat(rtCtx->readSwizzle(), GrSwizzle{"bgra"});
|
||||
return GrRenderTargetContext::Make(ctx,
|
||||
rtCtx->colorInfo().refColorSpace(),
|
||||
SkBackingFit::kExact,
|
||||
dimensions,
|
||||
rtCtx->asSurfaceProxy()->backendFormat(),
|
||||
/* sample count*/ 1,
|
||||
GrMipmapped::kNo,
|
||||
rtCtx->asSurfaceProxy()->isProtected(),
|
||||
readSwizzle,
|
||||
writeSwizzle,
|
||||
kTopLeft_GrSurfaceOrigin,
|
||||
SkBudgeted::kYes,
|
||||
/* surface props */ nullptr);
|
||||
return GrSurfaceDrawContext::Make(ctx,
|
||||
rtCtx->colorInfo().refColorSpace(),
|
||||
SkBackingFit::kExact,
|
||||
dimensions,
|
||||
rtCtx->asSurfaceProxy()->backendFormat(),
|
||||
/* sample count*/ 1,
|
||||
GrMipmapped::kNo,
|
||||
rtCtx->asSurfaceProxy()->isProtected(),
|
||||
readSwizzle,
|
||||
writeSwizzle,
|
||||
kTopLeft_GrSurfaceOrigin,
|
||||
SkBudgeted::kYes,
|
||||
/* surface props */ nullptr);
|
||||
};
|
||||
|
||||
struct {
|
||||
|
@ -35,11 +35,11 @@
|
||||
#include "src/gpu/GrProcessorSet.h"
|
||||
#include "src/gpu/GrProgramInfo.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrResourceProvider.h"
|
||||
#include "src/gpu/GrSamplerState.h"
|
||||
#include "src/gpu/GrShaderCaps.h"
|
||||
#include "src/gpu/GrShaderVar.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrSurfaceProxy.h"
|
||||
#include "src/gpu/GrTextureProxy.h"
|
||||
#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
|
||||
@ -69,7 +69,7 @@ static constexpr GrGeometryProcessor::Attribute gVertex =
|
||||
class ClockwiseGM : public skiagm::GpuGM {
|
||||
SkString onShortName() override { return SkString("clockwise"); }
|
||||
SkISize onISize() override { return {300, 200}; }
|
||||
void onDraw(GrRecordingContext*, GrRenderTargetContext*, SkCanvas*) override;
|
||||
void onDraw(GrRecordingContext*, GrSurfaceDrawContext*, SkCanvas*) override;
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -244,7 +244,7 @@ private:
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Test.
|
||||
|
||||
void ClockwiseGM::onDraw(GrRecordingContext* ctx, GrRenderTargetContext* rtc, SkCanvas* canvas) {
|
||||
void ClockwiseGM::onDraw(GrRecordingContext* ctx, GrSurfaceDrawContext* rtc, SkCanvas* canvas) {
|
||||
rtc->clear(SK_PMColor4fBLACK);
|
||||
|
||||
// Draw the test directly to the frame buffer.
|
||||
@ -253,7 +253,7 @@ void ClockwiseGM::onDraw(GrRecordingContext* ctx, GrRenderTargetContext* rtc, Sk
|
||||
|
||||
// Draw the test to an off-screen, top-down render target.
|
||||
GrColorType rtcColorType = rtc->colorInfo().colorType();
|
||||
if (auto topLeftRTC = GrRenderTargetContext::Make(
|
||||
if (auto topLeftRTC = GrSurfaceDrawContext::Make(
|
||||
ctx, rtcColorType, nullptr, SkBackingFit::kExact, {100, 200}, 1,
|
||||
GrMipmapped::kNo, GrProtected::kNo, kTopLeft_GrSurfaceOrigin, SkBudgeted::kYes,
|
||||
nullptr)) {
|
||||
@ -277,7 +277,7 @@ void ClockwiseGM::onDraw(GrRecordingContext* ctx, GrRenderTargetContext* rtc, Sk
|
||||
}
|
||||
|
||||
// Draw the test to an off-screen, bottom-up render target.
|
||||
if (auto topLeftRTC = GrRenderTargetContext::Make(
|
||||
if (auto topLeftRTC = GrSurfaceDrawContext::Make(
|
||||
ctx, rtcColorType, nullptr, SkBackingFit::kExact, {100, 200}, 1,
|
||||
GrMipmapped::kNo, GrProtected::kNo, kBottomLeft_GrSurfaceOrigin, SkBudgeted::kYes,
|
||||
nullptr)) {
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "src/image/SkImage_GpuBase.h"
|
||||
#include "third_party/etc1/etc1.h"
|
||||
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
|
||||
static SkPoint gen_pt(float angle, const SkVector& scale) {
|
||||
SkScalar s = SkScalarSin(angle);
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "src/gpu/GrColor.h"
|
||||
#include "src/gpu/GrFragmentProcessor.h"
|
||||
#include "src/gpu/GrPaint.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/SkGr.h"
|
||||
#include "src/gpu/effects/generated/GrConstColorProcessor.h"
|
||||
#include "src/gpu/ops/GrDrawOp.h"
|
||||
@ -79,7 +79,7 @@ protected:
|
||||
SkTileMode::kClamp);
|
||||
}
|
||||
|
||||
void onDraw(GrRecordingContext* context, GrRenderTargetContext* renderTargetContext,
|
||||
void onDraw(GrRecordingContext* context, GrSurfaceDrawContext* renderTargetContext,
|
||||
SkCanvas* canvas) override {
|
||||
constexpr GrColor kColors[] = {
|
||||
0xFFFFFFFF,
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "src/core/SkTLList.h"
|
||||
#include "src/gpu/GrFragmentProcessor.h"
|
||||
#include "src/gpu/GrPaint.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/effects/GrConvexPolyEffect.h"
|
||||
#include "tools/gpu/TestOps.h"
|
||||
|
||||
@ -106,7 +106,7 @@ protected:
|
||||
fRects.addToTail(SkRect::MakeLTRB(100.f, 50.5f, 5.f, 0.5f));
|
||||
}
|
||||
|
||||
void onDraw(GrRecordingContext* context, GrRenderTargetContext* renderTargetContext,
|
||||
void onDraw(GrRecordingContext* context, GrSurfaceDrawContext* renderTargetContext,
|
||||
SkCanvas* canvas) override {
|
||||
SkScalar y = 0;
|
||||
static constexpr SkScalar kDX = 12.f;
|
||||
|
@ -25,7 +25,7 @@ namespace skiagm {
|
||||
constexpr SkRect kSrcImageClip{75, 75, 275, 275};
|
||||
|
||||
/*
|
||||
* The purpose of this test is to exercise all three codepaths in GrRenderTargetContext
|
||||
* The purpose of this test is to exercise all three codepaths in GrSurfaceDrawContext
|
||||
* (drawFilledRect, fillRectToRect, fillRectWithLocalMatrix) that pre-crop filled rects based on the
|
||||
* clip.
|
||||
*
|
||||
@ -63,7 +63,7 @@ private:
|
||||
canvas->clear(SK_ColorWHITE);
|
||||
|
||||
{
|
||||
// GrRenderTargetContext::drawFilledRect.
|
||||
// GrSurfaceDrawContext::drawFilledRect.
|
||||
SkAutoCanvasRestore acr(canvas, true);
|
||||
SkPaint paint;
|
||||
paint.setShader(fSrcImageShader);
|
||||
@ -72,7 +72,7 @@ private:
|
||||
}
|
||||
|
||||
{
|
||||
// GrRenderTargetContext::fillRectToRect.
|
||||
// GrSurfaceDrawContext::fillRectToRect.
|
||||
SkAutoCanvasRestore acr(canvas, true);
|
||||
SkPaint paint;
|
||||
SkRect drawRect = SkRect::MakeXYWH(350, 100, 100, 300);
|
||||
@ -85,7 +85,7 @@ private:
|
||||
}
|
||||
|
||||
{
|
||||
// GrRenderTargetContext::fillRectWithLocalMatrix.
|
||||
// GrSurfaceDrawContext::fillRectWithLocalMatrix.
|
||||
SkAutoCanvasRestore acr(canvas, true);
|
||||
SkPath path = SkPath::Line(
|
||||
{kSrcImageClip.fLeft - kSrcImageClip.width(), kSrcImageClip.centerY()},
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "include/gpu/GrRecordingContext.h"
|
||||
#include "tools/Resources.h"
|
||||
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
|
||||
DEF_SIMPLE_GPU_GM_CAN_FAIL(cross_context_image, context, rtc, canvas, errorMsg,
|
||||
3 * 256 + 40, 256 + 128 + 30) {
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "include/utils/SkRandom.h"
|
||||
#include "tools/ToolUtils.h"
|
||||
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
|
||||
namespace skiagm {
|
||||
|
||||
@ -43,7 +43,7 @@ protected:
|
||||
return SkISize::Make(100, 100);
|
||||
}
|
||||
|
||||
DrawResult onDraw(GrRecordingContext* context, GrRenderTargetContext*, SkCanvas* canvas,
|
||||
DrawResult onDraw(GrRecordingContext* context, GrSurfaceDrawContext*, SkCanvas* canvas,
|
||||
SkString* errorMsg) override {
|
||||
auto direct = context->asDirectContext();
|
||||
if (!direct) {
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "include/private/GrTypesPriv.h"
|
||||
#include "src/core/SkMatrixProvider.h"
|
||||
#include "src/gpu/GrPaint.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/SkGr.h"
|
||||
#include "tools/ToolUtils.h"
|
||||
|
||||
@ -48,7 +48,7 @@ static void draw_gradient_tiles(SkCanvas* canvas, bool alignGradients) {
|
||||
static constexpr SkPoint pts[] = { {0.f, 0.f}, {0.25f * kTileWidth, 0.25f * kTileHeight} };
|
||||
static constexpr SkColor colors[] = { SK_ColorBLUE, SK_ColorWHITE };
|
||||
|
||||
GrRenderTargetContext* rtc = canvas->internal_private_accessTopLayerRenderTargetContext();
|
||||
GrSurfaceDrawContext* rtc = canvas->internal_private_accessTopLayerRenderTargetContext();
|
||||
|
||||
auto context = canvas->recordingContext();
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include <string.h>
|
||||
#include <utility>
|
||||
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
|
||||
static const int kNumMatrices = 6;
|
||||
static const int kImageSize = 128;
|
||||
@ -268,7 +268,7 @@ private:
|
||||
fReferenceImages[0] = fReferenceImages[1] = nullptr;
|
||||
}
|
||||
|
||||
void onDraw(GrRecordingContext*, GrRenderTargetContext*, SkCanvas* canvas) override {
|
||||
void onDraw(GrRecordingContext*, GrSurfaceDrawContext*, SkCanvas* canvas) override {
|
||||
SkASSERT(fReferenceImages[0] && fReferenceImages[1]);
|
||||
|
||||
canvas->save();
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "src/gpu/GrDirectContextPriv.h"
|
||||
#include "tools/ToolUtils.h"
|
||||
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
|
||||
static SkScalar draw_string(SkCanvas* canvas, const SkString& text, SkScalar x,
|
||||
SkScalar y, const SkFont& font) {
|
||||
@ -67,7 +67,7 @@ protected:
|
||||
fTypefaces[5] = ToolUtils::create_portable_typeface("sans-serif", SkFontStyle::Bold());
|
||||
}
|
||||
|
||||
void onDraw(GrRecordingContext*, GrRenderTargetContext*, SkCanvas* canvas) override {
|
||||
void onDraw(GrRecordingContext*, GrSurfaceDrawContext*, SkCanvas* canvas) override {
|
||||
this->drawText(canvas);
|
||||
// Debugging tool for GPU.
|
||||
static const bool kShowAtlas = false;
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include "src/gpu/GrDirectContextPriv.h"
|
||||
#include "tools/ToolUtils.h"
|
||||
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
|
||||
static sk_sp<SkTextBlob> make_blob(const SkString& text, const SkFont& font) {
|
||||
size_t len = text.size();
|
||||
@ -82,7 +82,7 @@ class FontRegenGM : public skiagm::GpuGM {
|
||||
fBlobs[2] = make_blob(kTexts[2], font);
|
||||
}
|
||||
|
||||
void onDraw(GrRecordingContext* context, GrRenderTargetContext*, SkCanvas* canvas) override {
|
||||
void onDraw(GrRecordingContext* context, GrSurfaceDrawContext*, SkCanvas* canvas) override {
|
||||
auto direct = context->asDirectContext();
|
||||
if (!direct) {
|
||||
return;
|
||||
@ -143,7 +143,7 @@ class BadAppleGM : public skiagm::GpuGM {
|
||||
fBlobs[1] = make_blob(kTexts[1], font);
|
||||
}
|
||||
|
||||
void onDraw(GrRecordingContext* context, GrRenderTargetContext*, SkCanvas* canvas) override {
|
||||
void onDraw(GrRecordingContext* context, GrSurfaceDrawContext*, SkCanvas* canvas) override {
|
||||
SkPaint paint;
|
||||
paint.setColor(0xFF111111);
|
||||
canvas->drawTextBlob(fBlobs[0], 10, 260, paint);
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "src/gpu/GrCaps.h"
|
||||
#include "src/gpu/GrDirectContextPriv.h"
|
||||
#include "src/gpu/GrFragmentProcessor.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/effects/GrRRectEffect.h"
|
||||
#include "src/gpu/effects/GrSkSLFP.h"
|
||||
#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
|
||||
|
@ -30,10 +30,10 @@
|
||||
#include "src/gpu/GrProcessorSet.h"
|
||||
#include "src/gpu/GrProgramInfo.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrResourceProvider.h"
|
||||
#include "src/gpu/GrShaderCaps.h"
|
||||
#include "src/gpu/GrShaderVar.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
|
||||
#include "src/gpu/glsl/GrGLSLGeometryProcessor.h"
|
||||
#include "src/gpu/glsl/GrGLSLPrimitiveProcessor.h"
|
||||
|
10
gm/gm.cpp
10
gm/gm.cpp
@ -25,7 +25,7 @@
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
|
||||
using namespace skiagm;
|
||||
|
||||
@ -142,7 +142,7 @@ DrawResult SimpleGM::onDraw(SkCanvas* canvas, SkString* errorMsg) {
|
||||
|
||||
SkISize SimpleGpuGM::onISize() { return fSize; }
|
||||
SkString SimpleGpuGM::onShortName() { return fName; }
|
||||
DrawResult SimpleGpuGM::onDraw(GrRecordingContext* ctx, GrRenderTargetContext* rtc,
|
||||
DrawResult SimpleGpuGM::onDraw(GrRecordingContext* ctx, GrSurfaceDrawContext* rtc,
|
||||
SkCanvas* canvas, SkString* errorMsg) {
|
||||
return fDrawProc(ctx, rtc, canvas, errorMsg);
|
||||
}
|
||||
@ -187,19 +187,19 @@ void GM::drawSizeBounds(SkCanvas* canvas, SkColor color) {
|
||||
// need to explicitly declare this, or we get some weird infinite loop llist
|
||||
template GMRegistry* GMRegistry::gHead;
|
||||
|
||||
DrawResult GpuGM::onDraw(GrRecordingContext* ctx, GrRenderTargetContext* rtc, SkCanvas* canvas,
|
||||
DrawResult GpuGM::onDraw(GrRecordingContext* ctx, GrSurfaceDrawContext* rtc, SkCanvas* canvas,
|
||||
SkString* errorMsg) {
|
||||
this->onDraw(ctx, rtc, canvas);
|
||||
return DrawResult::kOk;
|
||||
}
|
||||
void GpuGM::onDraw(GrRecordingContext*, GrRenderTargetContext*, SkCanvas*) {
|
||||
void GpuGM::onDraw(GrRecordingContext*, GrSurfaceDrawContext*, SkCanvas*) {
|
||||
SK_ABORT("Not implemented.");
|
||||
}
|
||||
|
||||
DrawResult GpuGM::onDraw(SkCanvas* canvas, SkString* errorMsg) {
|
||||
|
||||
auto ctx = canvas->recordingContext();
|
||||
GrRenderTargetContext* rtc = canvas->internal_private_accessTopLayerRenderTargetContext();
|
||||
GrSurfaceDrawContext* rtc = canvas->internal_private_accessTopLayerRenderTargetContext();
|
||||
if (!ctx || !rtc) {
|
||||
*errorMsg = kErrorMsg_DrawSkippedGpuOnly;
|
||||
return DrawResult::kSkip;
|
||||
|
20
gm/gm.h
20
gm/gm.h
@ -21,7 +21,7 @@
|
||||
|
||||
class GrDirectContext;
|
||||
class GrRecordingContext;
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
class SkCanvas;
|
||||
class SkMetaData;
|
||||
struct GrContextOptions;
|
||||
@ -63,7 +63,7 @@ struct GrContextOptions;
|
||||
#define DEF_SIMPLE_GPU_GM(NAME, GR_CONTEXT, RENDER_TARGET_CONTEXT, CANVAS, W, H) \
|
||||
DEF_SIMPLE_GPU_GM_BG(NAME, GR_CONTEXT, RENDER_TARGET_CONTEXT, CANVAS, W, H, SK_ColorWHITE)
|
||||
#define DEF_SIMPLE_GPU_GM_BG(NAME, GR_CONTEXT, RENDER_TARGET_CONTEXT, CANVAS, W, H, BGCOLOR) \
|
||||
static void SK_MACRO_CONCAT(NAME,_GM_inner)(GrRecordingContext*, GrRenderTargetContext*, \
|
||||
static void SK_MACRO_CONCAT(NAME,_GM_inner)(GrRecordingContext*, GrSurfaceDrawContext*, \
|
||||
SkCanvas*); \
|
||||
DEF_SIMPLE_GPU_GM_BG_CAN_FAIL(NAME, GR_CONTEXT, RENDER_TARGET_CONTEXT, CANVAS,, W, H, \
|
||||
BGCOLOR) { \
|
||||
@ -71,7 +71,7 @@ struct GrContextOptions;
|
||||
return skiagm::DrawResult::kOk; \
|
||||
} \
|
||||
void SK_MACRO_CONCAT(NAME,_GM_inner)( \
|
||||
GrRecordingContext* GR_CONTEXT, GrRenderTargetContext* RENDER_TARGET_CONTEXT, \
|
||||
GrRecordingContext* GR_CONTEXT, GrSurfaceDrawContext* RENDER_TARGET_CONTEXT, \
|
||||
SkCanvas* CANVAS)
|
||||
|
||||
#define DEF_SIMPLE_GPU_GM_CAN_FAIL(NAME, GR_CONTEXT, RENDER_TARGET_CONTEXT, CANVAS, ERR_MSG, W, H) \
|
||||
@ -80,11 +80,11 @@ struct GrContextOptions;
|
||||
#define DEF_SIMPLE_GPU_GM_BG_CAN_FAIL(NAME, GR_CONTEXT, RENDER_TARGET_CONTEXT, CANVAS, ERR_MSG, W, \
|
||||
H, BGCOLOR) \
|
||||
static skiagm::DrawResult SK_MACRO_CONCAT(NAME,_GM)( \
|
||||
GrRecordingContext*, GrRenderTargetContext*, SkCanvas*, SkString*); \
|
||||
GrRecordingContext*, GrSurfaceDrawContext*, SkCanvas*, SkString*); \
|
||||
DEF_GM(return new skiagm::SimpleGpuGM(BGCOLOR, SkString(#NAME), {W,H}, \
|
||||
SK_MACRO_CONCAT(NAME,_GM));) \
|
||||
skiagm::DrawResult SK_MACRO_CONCAT(NAME,_GM)( \
|
||||
GrRecordingContext* GR_CONTEXT, GrRenderTargetContext* RENDER_TARGET_CONTEXT, \
|
||||
GrRecordingContext* GR_CONTEXT, GrSurfaceDrawContext* RENDER_TARGET_CONTEXT, \
|
||||
SkCanvas* CANVAS, SkString* ERR_MSG)
|
||||
|
||||
namespace skiagm {
|
||||
@ -211,9 +211,9 @@ namespace skiagm {
|
||||
using GM::onDraw;
|
||||
DrawResult onDraw(SkCanvas*, SkString* errorMsg) final;
|
||||
|
||||
virtual DrawResult onDraw(GrRecordingContext*, GrRenderTargetContext*, SkCanvas*,
|
||||
virtual DrawResult onDraw(GrRecordingContext*, GrSurfaceDrawContext*, SkCanvas*,
|
||||
SkString* errorMsg);
|
||||
virtual void onDraw(GrRecordingContext*, GrRenderTargetContext*, SkCanvas*);
|
||||
virtual void onDraw(GrRecordingContext*, GrSurfaceDrawContext*, SkCanvas*);
|
||||
};
|
||||
|
||||
// SimpleGM is intended for basic GMs that can define their entire implementation inside a
|
||||
@ -236,15 +236,15 @@ namespace skiagm {
|
||||
|
||||
class SimpleGpuGM : public GpuGM {
|
||||
public:
|
||||
using DrawProc = DrawResult(*)(GrRecordingContext*, GrRenderTargetContext*,
|
||||
SkCanvas*, SkString* errorMsg);
|
||||
using DrawProc = DrawResult (*)(GrRecordingContext*, GrSurfaceDrawContext*,
|
||||
SkCanvas*, SkString* errorMsg);
|
||||
SimpleGpuGM(SkColor bgColor, const SkString& name, const SkISize& size, DrawProc drawProc)
|
||||
: GpuGM(bgColor), fName(name), fSize(size), fDrawProc(drawProc) {}
|
||||
|
||||
private:
|
||||
SkISize onISize() override;
|
||||
SkString onShortName() override;
|
||||
DrawResult onDraw(GrRecordingContext* ctx, GrRenderTargetContext* rtc, SkCanvas* canvas,
|
||||
DrawResult onDraw(GrRecordingContext* ctx, GrSurfaceDrawContext* rtc, SkCanvas* canvas,
|
||||
SkString* errorMsg) override;
|
||||
|
||||
const SkString fName;
|
||||
|
@ -32,9 +32,7 @@ static GrSurfaceProxyView blur(GrRecordingContext* ctx,
|
||||
return resultRTC->readSurfaceView();
|
||||
};
|
||||
|
||||
static void run(GrRecordingContext* rContext, GrRenderTargetContext* rtc,
|
||||
bool subsetSrc, bool ref) {
|
||||
|
||||
static void run(GrRecordingContext* rContext, GrSurfaceDrawContext* rtc, bool subsetSrc, bool ref) {
|
||||
auto srcII = SkImageInfo::Make(60, 60, kRGBA_8888_SkColorType, kPremul_SkAlphaType);
|
||||
auto surf = SkSurface::MakeRenderTarget(rContext, SkBudgeted::kYes, srcII);
|
||||
GrSurfaceProxyView src;
|
||||
@ -161,14 +159,14 @@ static void run(GrRecordingContext* rContext, GrRenderTargetContext* rtc,
|
||||
// If we're in ref mode we will create a temp image that has the original image
|
||||
// tiled into it and then do a clamp blur with adjusted params that should produce
|
||||
// the same result as the original params.
|
||||
std::unique_ptr<GrRenderTargetContext> refSrc;
|
||||
std::unique_ptr<GrSurfaceDrawContext> refSrc;
|
||||
SkIRect refRect;
|
||||
if (ref) {
|
||||
// Blow up testArea into a much larger rect so that our clamp blur will not
|
||||
// reach anywhere near the edge of our temp surface.
|
||||
refRect = testArea.makeOutset(testArea.width(), testArea.height());
|
||||
refSrc = GrRenderTargetContext::Make(rContext, GrColorType::kRGBA_8888, nullptr,
|
||||
SkBackingFit::kApprox, refRect.size());
|
||||
refSrc = GrSurfaceDrawContext::Make(rContext, GrColorType::kRGBA_8888, nullptr,
|
||||
SkBackingFit::kApprox, refRect.size());
|
||||
refSrc->clear(SK_PMColor4fWHITE);
|
||||
// Setup an effect to put the original src rect at the correct logical place
|
||||
// in the temp where the temp's origin is at the top left of refRect.
|
||||
|
@ -40,7 +40,7 @@
|
||||
#include <functional>
|
||||
#include <utility>
|
||||
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
|
||||
static void drawContents(SkSurface* surface, SkColor fillC) {
|
||||
SkSize size = SkSize::Make(SkIntToScalar(surface->width()),
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "tools/Resources.h"
|
||||
#include "tools/gpu/YUVUtils.h"
|
||||
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
|
||||
namespace skiagm {
|
||||
class ImageFromYUVTextures : public GpuGM {
|
||||
@ -195,7 +195,7 @@ protected:
|
||||
return fYUVAImages[index].get();
|
||||
}
|
||||
|
||||
void onDraw(GrRecordingContext*, GrRenderTargetContext*, SkCanvas* canvas) override {
|
||||
void onDraw(GrRecordingContext*, GrSurfaceDrawContext*, SkCanvas* canvas) override {
|
||||
auto draw_image = [canvas](SkImage* image, SkFilterQuality fq) -> SkSize {
|
||||
if (!image) {
|
||||
return {0, 0};
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "src/gpu/GrDirectContextPriv.h"
|
||||
#include "src/gpu/GrDrawingManager.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/ccpr/GrCCPathCache.h"
|
||||
#include "src/gpu/ccpr/GrCoverageCountingPathRenderer.h"
|
||||
#include "tools/ToolUtils.h"
|
||||
@ -59,7 +59,7 @@ private:
|
||||
ctxOptions->fAllowPathMaskCaching = true;
|
||||
}
|
||||
|
||||
DrawResult onDraw(GrRecordingContext* rContext, GrRenderTargetContext* rtc, SkCanvas* canvas,
|
||||
DrawResult onDraw(GrRecordingContext* rContext, GrSurfaceDrawContext* rtc, SkCanvas* canvas,
|
||||
SkString* errorMsg) override {
|
||||
using CoverageType = GrCCAtlas::CoverageType;
|
||||
|
||||
|
@ -40,7 +40,7 @@
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
|
||||
namespace skiagm {
|
||||
class RectangleTexture : public GpuGM {
|
||||
@ -147,7 +147,7 @@ private:
|
||||
fSmallImg = nullptr;
|
||||
}
|
||||
|
||||
DrawResult onDraw(GrRecordingContext*, GrRenderTargetContext*, SkCanvas* canvas,
|
||||
DrawResult onDraw(GrRecordingContext*, GrSurfaceDrawContext*, SkCanvas* canvas,
|
||||
SkString*) override {
|
||||
SkASSERT(fGradImgs[0] && fGradImgs[1] && fSmallImg);
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "include/core/SkTileMode.h"
|
||||
#include "include/effects/SkGradientShader.h"
|
||||
|
||||
// Exercises code in GrRenderTargetContext that attempts to replace a rrect clip/draw paint with
|
||||
// Exercises code in GrSurfaceDrawContext that attempts to replace a rrect clip/draw paint with
|
||||
// draw rrect.
|
||||
DEF_SIMPLE_GM(rrect_clip_draw_paint, canvas, 256, 256) {
|
||||
SkRRect rrect = SkRRect::MakeRectXY(SkRect::MakeXYWH(10.f, 10.f, 236.f, 236.f), 30.f, 40.f);
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "src/gpu/GrCaps.h"
|
||||
#include "src/gpu/GrFragmentProcessor.h"
|
||||
#include "src/gpu/GrPaint.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/effects/GrPorterDuffXferProcessor.h"
|
||||
#include "src/gpu/effects/GrRRectEffect.h"
|
||||
#include "src/gpu/ops/GrDrawOp.h"
|
||||
@ -78,7 +78,7 @@ protected:
|
||||
SkISize onISize() override { return SkISize::Make(kImageWidth, kImageHeight); }
|
||||
|
||||
DrawResult onDraw(SkCanvas* canvas, SkString* errorMsg) override {
|
||||
GrRenderTargetContext* renderTargetContext =
|
||||
GrSurfaceDrawContext* renderTargetContext =
|
||||
canvas->internal_private_accessTopLayerRenderTargetContext();
|
||||
auto context = canvas->recordingContext();
|
||||
if (kEffect_Type == fType && (!renderTargetContext || !context)) {
|
||||
|
@ -33,10 +33,10 @@
|
||||
#include "src/gpu/GrProcessor.h"
|
||||
#include "src/gpu/GrProcessorSet.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSamplerState.h"
|
||||
#include "src/gpu/GrShaderCaps.h"
|
||||
#include "src/gpu/GrShaderVar.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrSurfaceProxy.h"
|
||||
#include "src/gpu/GrTextureProxy.h"
|
||||
#include "src/gpu/GrUserStencilSettings.h"
|
||||
@ -83,7 +83,7 @@ private:
|
||||
}
|
||||
|
||||
SkISize onISize() override { return SkISize::Make(200, 200); }
|
||||
DrawResult onDraw(GrRecordingContext*, GrRenderTargetContext*,
|
||||
DrawResult onDraw(GrRecordingContext*, GrSurfaceDrawContext*,
|
||||
SkCanvas*, SkString* errorMsg) override;
|
||||
|
||||
const GradType fGradType;
|
||||
@ -316,7 +316,7 @@ private:
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Test.
|
||||
|
||||
DrawResult SampleLocationsGM::onDraw(GrRecordingContext* ctx, GrRenderTargetContext* rtc,
|
||||
DrawResult SampleLocationsGM::onDraw(GrRecordingContext* ctx, GrSurfaceDrawContext* rtc,
|
||||
SkCanvas* canvas, SkString* errorMsg) {
|
||||
if (!ctx->priv().caps()->sampleLocationsSupport()) {
|
||||
*errorMsg = "Requires support for sample locations.";
|
||||
@ -335,7 +335,7 @@ DrawResult SampleLocationsGM::onDraw(GrRecordingContext* ctx, GrRenderTargetCont
|
||||
return DrawResult::kSkip;
|
||||
}
|
||||
|
||||
auto offscreenRTC = GrRenderTargetContext::Make(
|
||||
auto offscreenRTC = GrSurfaceDrawContext::Make(
|
||||
ctx, rtc->colorInfo().colorType(), nullptr, SkBackingFit::kExact, {200, 200},
|
||||
rtc->numSamples(), GrMipmapped::kNo, GrProtected::kNo, fOrigin);
|
||||
if (!offscreenRTC) {
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "src/gpu/GrBitmapTextureMaker.h"
|
||||
#include "src/gpu/GrDirectContextPriv.h"
|
||||
#include "src/gpu/GrFragmentProcessor.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/ops/GrFillRectOp.h"
|
||||
#include "tools/Resources.h"
|
||||
#include "tools/ToolUtils.h"
|
||||
|
@ -16,9 +16,9 @@
|
||||
#include "src/gpu/GrPrimitiveProcessor.h"
|
||||
#include "src/gpu/GrProgramInfo.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrShaderCaps.h"
|
||||
#include "src/gpu/GrShaderVar.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/glsl/GrGLSLFragmentShaderBuilder.h"
|
||||
#include "src/gpu/glsl/GrGLSLGeometryProcessor.h"
|
||||
#include "src/gpu/glsl/GrGLSLPrimitiveProcessor.h"
|
||||
@ -48,7 +48,7 @@ constexpr static int kHeight = (int)kRect.fBottom + 21;
|
||||
class TessellationGM : public GpuGM {
|
||||
SkString onShortName() override { return SkString("tessellation"); }
|
||||
SkISize onISize() override { return {kWidth, kHeight}; }
|
||||
DrawResult onDraw(GrRecordingContext*, GrRenderTargetContext*, SkCanvas*, SkString*) override;
|
||||
DrawResult onDraw(GrRecordingContext*, GrSurfaceDrawContext*, SkCanvas*, SkString*) override;
|
||||
};
|
||||
|
||||
|
||||
@ -379,7 +379,7 @@ static SkPath build_outset_triangle(const std::array<float, 3>* tri) {
|
||||
return outset;
|
||||
}
|
||||
|
||||
DrawResult TessellationGM::onDraw(GrRecordingContext* ctx, GrRenderTargetContext* rtc,
|
||||
DrawResult TessellationGM::onDraw(GrRecordingContext* ctx, GrSurfaceDrawContext* rtc,
|
||||
SkCanvas* canvas, SkString* errorMsg) {
|
||||
if (!ctx->priv().caps()->shaderCaps()->tessellationSupport()) {
|
||||
*errorMsg = "Requires GPU tessellation support.";
|
||||
|
@ -22,8 +22,8 @@
|
||||
#include "src/gpu/GrBitmapTextureMaker.h"
|
||||
#include "src/gpu/GrDirectContextPriv.h"
|
||||
#include "src/gpu/GrProxyProvider.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSamplerState.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrTextureProxy.h"
|
||||
#include "src/gpu/effects/generated/GrConstColorProcessor.h"
|
||||
#include "tools/Resources.h"
|
||||
@ -86,7 +86,7 @@ protected:
|
||||
SkASSERT(fBitmap.dimensions() == kImageSize);
|
||||
}
|
||||
|
||||
DrawResult onDraw(GrRecordingContext* context, GrRenderTargetContext* renderTargetContext,
|
||||
DrawResult onDraw(GrRecordingContext* context, GrSurfaceDrawContext* renderTargetContext,
|
||||
SkCanvas* canvas, SkString* errorMsg) override {
|
||||
GrMipmapped mipmapped = (fMipmapMode != MipmapMode::kNone) ? GrMipmapped::kYes
|
||||
: GrMipmapped::kNo;
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include <string.h>
|
||||
#include <utility>
|
||||
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
|
||||
namespace skiagm {
|
||||
class TextBlobRandomFont : public GpuGM {
|
||||
@ -107,7 +107,8 @@ protected:
|
||||
return SkISize::Make(kWidth, kHeight);
|
||||
}
|
||||
|
||||
DrawResult onDraw(GrRecordingContext* context, GrRenderTargetContext*, SkCanvas* canvas,
|
||||
DrawResult onDraw(GrRecordingContext* context,
|
||||
GrSurfaceDrawContext*, SkCanvas* canvas,
|
||||
SkString* errorMsg) override {
|
||||
// This GM exists to test a specific feature of the GPU backend.
|
||||
// This GM uses ToolUtils::makeSurface which doesn't work well with vias.
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
|
||||
// This tests that we correctly regenerate textblobs after freeing all gpu resources crbug/491350
|
||||
namespace skiagm {
|
||||
@ -37,7 +37,7 @@ protected:
|
||||
return SkISize::Make(kWidth, kHeight);
|
||||
}
|
||||
|
||||
void onDraw(GrRecordingContext* context, GrRenderTargetContext*, SkCanvas* canvas) override {
|
||||
void onDraw(GrRecordingContext* context, GrSurfaceDrawContext*, SkCanvas* canvas) override {
|
||||
const char text[] = "Hamburgefons";
|
||||
|
||||
SkFont font(ToolUtils::create_portable_typeface(), 20);
|
||||
|
@ -180,7 +180,7 @@ class TrickyCubicStrokes_tess_segs_5 : public skiagm::GpuGM {
|
||||
(int)GpuPathRenderers::kTessellation);
|
||||
}
|
||||
|
||||
DrawResult onDraw(GrRecordingContext* context, GrRenderTargetContext*, SkCanvas* canvas,
|
||||
DrawResult onDraw(GrRecordingContext* context, GrSurfaceDrawContext*, SkCanvas* canvas,
|
||||
SkString* errorMsg) override {
|
||||
if (!context->priv().caps()->shaderCaps()->tessellationSupport() ||
|
||||
!GrTessellationPathRenderer::IsSupported(*context->priv().caps())) {
|
||||
|
@ -58,7 +58,7 @@
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
|
||||
static const int kTileWidthHeight = 128;
|
||||
static const int kLabelWidth = 64;
|
||||
@ -1051,7 +1051,7 @@ protected:
|
||||
fImages[0][0] = fImages[0][1] = fImages[1][0] = fImages[1][1] = nullptr;
|
||||
}
|
||||
|
||||
DrawResult onDraw(GrRecordingContext* rContext, GrRenderTargetContext*,
|
||||
DrawResult onDraw(GrRecordingContext* rContext, GrSurfaceDrawContext*,
|
||||
SkCanvas* canvas, SkString* msg) override {
|
||||
SkASSERT(fImages[0][0] && fImages[0][1] && fImages[1][0] && fImages[1][1]);
|
||||
|
||||
|
@ -98,7 +98,8 @@ class WideButtCaps_tess_segs_5 : public skiagm::GpuGM {
|
||||
(int)GpuPathRenderers::kTessellation);
|
||||
}
|
||||
|
||||
DrawResult onDraw(GrRecordingContext* context, GrRenderTargetContext* rtc, SkCanvas* canvas,
|
||||
DrawResult onDraw(GrRecordingContext* context,
|
||||
GrSurfaceDrawContext* rtc, SkCanvas* canvas,
|
||||
SkString* errorMsg) override {
|
||||
if (!context->priv().caps()->shaderCaps()->tessellationSupport() ||
|
||||
!GrTessellationPathRenderer::IsSupported(*context->priv().caps())) {
|
||||
|
@ -33,8 +33,8 @@
|
||||
#include "src/gpu/GrPaint.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrReducedClip.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrStencilClip.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrTextureProxy.h"
|
||||
#include "src/gpu/GrUserStencilSettings.h"
|
||||
#include "src/gpu/effects/generated/GrDeviceSpaceEffect.h"
|
||||
@ -150,11 +150,11 @@ private:
|
||||
constexpr static int kMaskCheckerSize = 5;
|
||||
SkString onShortName() final { return SkString("windowrectangles_mask"); }
|
||||
DrawResult onCoverClipStack(const SkClipStack&, SkCanvas*, SkString* errorMsg) final;
|
||||
void visualizeAlphaMask(GrRecordingContext*, GrRenderTargetContext*,
|
||||
void visualizeAlphaMask(GrRecordingContext*, GrSurfaceDrawContext*,
|
||||
const GrReducedClip&, GrPaint&&);
|
||||
void visualizeStencilMask(GrRecordingContext*, GrRenderTargetContext*,
|
||||
void visualizeStencilMask(GrRecordingContext*, GrSurfaceDrawContext*,
|
||||
const GrReducedClip&, GrPaint&&);
|
||||
void stencilCheckerboard(GrRenderTargetContext*, bool flip);
|
||||
void stencilCheckerboard(GrSurfaceDrawContext*, bool flip);
|
||||
};
|
||||
|
||||
/**
|
||||
@ -168,7 +168,7 @@ private:
|
||||
SkIRect getConservativeBounds() const final {
|
||||
return SkIRect::MakeXYWH(fX, fY, fMask.width(), fMask.height());
|
||||
}
|
||||
Effect apply(GrRecordingContext* ctx, GrRenderTargetContext*, GrAAType, bool,
|
||||
Effect apply(GrRecordingContext* ctx, GrSurfaceDrawContext*, GrAAType, bool,
|
||||
GrAppliedClip* out, SkRect* bounds) const override {
|
||||
GrSamplerState samplerState(GrSamplerState::WrapMode::kClampToBorder,
|
||||
GrSamplerState::Filter::kNearest);
|
||||
@ -189,14 +189,14 @@ private:
|
||||
/**
|
||||
* Makes a clip object that enforces the stencil clip bit. Used to visualize the stencil mask.
|
||||
*/
|
||||
static GrStencilClip make_stencil_only_clip(GrRenderTargetContext* rtc) {
|
||||
static GrStencilClip make_stencil_only_clip(GrSurfaceDrawContext* rtc) {
|
||||
return GrStencilClip(rtc->dimensions(), SkClipStack::kEmptyGenID);
|
||||
};
|
||||
|
||||
DrawResult WindowRectanglesMaskGM::onCoverClipStack(const SkClipStack& stack, SkCanvas* canvas,
|
||||
SkString* errorMsg) {
|
||||
auto ctx = canvas->recordingContext();
|
||||
GrRenderTargetContext* rtc = canvas->internal_private_accessTopLayerRenderTargetContext();
|
||||
GrSurfaceDrawContext* rtc = canvas->internal_private_accessTopLayerRenderTargetContext();
|
||||
if (!ctx || !rtc) {
|
||||
*errorMsg = kErrorMsg_DrawSkippedGpuOnly;
|
||||
return DrawResult::kSkip;
|
||||
@ -220,11 +220,11 @@ DrawResult WindowRectanglesMaskGM::onCoverClipStack(const SkClipStack& stack, Sk
|
||||
return DrawResult::kOk;
|
||||
}
|
||||
|
||||
void WindowRectanglesMaskGM::visualizeAlphaMask(GrRecordingContext* ctx, GrRenderTargetContext* rtc,
|
||||
void WindowRectanglesMaskGM::visualizeAlphaMask(GrRecordingContext* ctx, GrSurfaceDrawContext* rtc,
|
||||
const GrReducedClip& reducedClip, GrPaint&& paint) {
|
||||
const int padRight = (kDeviceRect.right() - kCoverRect.right()) / 2;
|
||||
const int padBottom = (kDeviceRect.bottom() - kCoverRect.bottom()) / 2;
|
||||
auto maskRTC = GrRenderTargetContext::MakeWithFallback(
|
||||
auto maskRTC = GrSurfaceDrawContext::MakeWithFallback(
|
||||
ctx, GrColorType::kAlpha_8, nullptr, SkBackingFit::kExact,
|
||||
{kCoverRect.width() + padRight, kCoverRect.height() + padBottom});
|
||||
if (!maskRTC) {
|
||||
@ -254,7 +254,7 @@ void WindowRectanglesMaskGM::visualizeAlphaMask(GrRecordingContext* ctx, GrRende
|
||||
}
|
||||
|
||||
void WindowRectanglesMaskGM::visualizeStencilMask(GrRecordingContext* ctx,
|
||||
GrRenderTargetContext* rtc,
|
||||
GrSurfaceDrawContext* rtc,
|
||||
const GrReducedClip& reducedClip,
|
||||
GrPaint&& paint) {
|
||||
if (ctx->abandoned()) {
|
||||
@ -275,7 +275,7 @@ void WindowRectanglesMaskGM::visualizeStencilMask(GrRecordingContext* ctx,
|
||||
rtc->drawPaint(&clip, std::move(paint), SkMatrix::I());
|
||||
}
|
||||
|
||||
void WindowRectanglesMaskGM::stencilCheckerboard(GrRenderTargetContext* rtc, bool flip) {
|
||||
void WindowRectanglesMaskGM::stencilCheckerboard(GrSurfaceDrawContext* rtc, bool flip) {
|
||||
constexpr static GrUserStencilSettings kSetClip(
|
||||
GrUserStencilSettings::StaticInit<
|
||||
0,
|
||||
|
@ -91,7 +91,7 @@ protected:
|
||||
fYCbCrImage = nullptr;
|
||||
}
|
||||
|
||||
DrawResult onDraw(GrRecordingContext*, GrRenderTargetContext*,
|
||||
DrawResult onDraw(GrRecordingContext*, GrSurfaceDrawContext*,
|
||||
SkCanvas* canvas, SkString*) override {
|
||||
SkASSERT(fYCbCrImage);
|
||||
|
||||
|
@ -21,8 +21,8 @@
|
||||
#include "src/gpu/GrBitmapTextureMaker.h"
|
||||
#include "src/gpu/GrDirectContextPriv.h"
|
||||
#include "src/gpu/GrPaint.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSamplerState.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrTextureProxy.h"
|
||||
#include "src/gpu/effects/GrYUVtoRGBEffect.h"
|
||||
|
||||
@ -84,7 +84,7 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
DrawResult onDraw(GrRecordingContext* context, GrRenderTargetContext* renderTargetContext,
|
||||
DrawResult onDraw(GrRecordingContext* context, GrSurfaceDrawContext* renderTargetContext,
|
||||
SkCanvas* canvas, SkString* errorMsg) override {
|
||||
GrSurfaceProxyView views[3];
|
||||
|
||||
|
@ -173,8 +173,6 @@ skia_gpu_sources = [
|
||||
"$_src/gpu/GrReducedClip.h",
|
||||
"$_src/gpu/GrRenderTarget.cpp",
|
||||
"$_src/gpu/GrRenderTarget.h",
|
||||
"$_src/gpu/GrRenderTargetContext.cpp",
|
||||
"$_src/gpu/GrRenderTargetContext.h",
|
||||
"$_src/gpu/GrRenderTargetProxy.cpp",
|
||||
"$_src/gpu/GrRenderTargetProxy.h",
|
||||
"$_src/gpu/GrRenderTask.cpp",
|
||||
@ -223,6 +221,8 @@ skia_gpu_sources = [
|
||||
"$_src/gpu/GrSurface.h",
|
||||
"$_src/gpu/GrSurfaceContext.cpp",
|
||||
"$_src/gpu/GrSurfaceContext.h",
|
||||
"$_src/gpu/GrSurfaceDrawContext.cpp",
|
||||
"$_src/gpu/GrSurfaceDrawContext.h",
|
||||
"$_src/gpu/GrSurfaceProxy.cpp",
|
||||
"$_src/gpu/GrSurfaceProxy.h",
|
||||
"$_src/gpu/GrSurfaceProxyPriv.h",
|
||||
|
@ -36,7 +36,7 @@
|
||||
#define SK_SUPPORT_LEGACY_GETTOTALMATRIX
|
||||
|
||||
class GrRecordingContext;
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
class SkBaseDevice;
|
||||
class SkBitmap;
|
||||
class SkData;
|
||||
@ -2457,7 +2457,7 @@ public:
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// don't call
|
||||
virtual GrRenderTargetContext* internal_private_accessTopLayerRenderTargetContext();
|
||||
virtual GrSurfaceDrawContext* internal_private_accessTopLayerRenderTargetContext();
|
||||
SkIRect internal_private_getTopLayerBounds() const { return getTopLayerBounds(); }
|
||||
|
||||
// TEMP helpers until we switch virtual over to const& for src-rect
|
||||
|
@ -29,7 +29,7 @@ struct GrMockOptions;
|
||||
class GrPath;
|
||||
class GrResourceCache;
|
||||
class GrSmallPathAtlasMgr;
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
class GrResourceProvider;
|
||||
class GrStrikeCache;
|
||||
class GrSurfaceProxy;
|
||||
|
@ -43,7 +43,7 @@ private:
|
||||
|
||||
// In debug builds we guard against improper thread handling
|
||||
// This guard is passed to the GrDrawingManager and, from there to all the
|
||||
// GrRenderTargetContexts. It is also passed to the GrResourceProvider and SkGpuDevice.
|
||||
// GrSurfaceDrawContexts. It is also passed to the GrResourceProvider and SkGpuDevice.
|
||||
mutable GrSingleOwner fSingleOwner;
|
||||
|
||||
using INHERITED = GrContext_Base;
|
||||
|
@ -32,7 +32,7 @@ public:
|
||||
// Forwarded to the wrapped canvas.
|
||||
SkISize getBaseLayerSize() const override { return proxy()->getBaseLayerSize(); }
|
||||
GrRecordingContext* recordingContext() override { return proxy()->recordingContext(); }
|
||||
GrRenderTargetContext* internal_private_accessTopLayerRenderTargetContext() override {
|
||||
GrSurfaceDrawContext* internal_private_accessTopLayerRenderTargetContext() override {
|
||||
return proxy()->internal_private_accessTopLayerRenderTargetContext();
|
||||
}
|
||||
|
||||
|
@ -21,8 +21,8 @@
|
||||
#include "src/gpu/GrOnFlushResourceProvider.h"
|
||||
#include "src/gpu/GrOpFlushState.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrResourceProvider.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/ccpr/GrCCCoverageProcessor.h"
|
||||
#include "src/gpu/ccpr/GrCCFillGeometry.h"
|
||||
#include "src/gpu/ccpr/GrGSCoverageProcessor.h"
|
||||
@ -193,7 +193,7 @@ void CCPRGeometryView::onDrawContent(SkCanvas* canvas) {
|
||||
|
||||
if (fDoStroke) {
|
||||
caption.appendf(" (stroke_width=%f)", fStrokeWidth);
|
||||
} else if (GrRenderTargetContext* rtc =
|
||||
} else if (GrSurfaceDrawContext* rtc =
|
||||
canvas->internal_private_accessTopLayerRenderTargetContext()) {
|
||||
// Render coverage count.
|
||||
auto ctx = canvas->recordingContext();
|
||||
@ -201,7 +201,7 @@ void CCPRGeometryView::onDrawContent(SkCanvas* canvas) {
|
||||
|
||||
int width = this->width();
|
||||
int height = this->height();
|
||||
auto ccbuff = GrRenderTargetContext::Make(
|
||||
auto ccbuff = GrSurfaceDrawContext::Make(
|
||||
ctx, GrColorType::kAlpha_F16, nullptr, SkBackingFit::kApprox, {width, height});
|
||||
SkASSERT(ccbuff);
|
||||
ccbuff->clear(SK_PMColor4fTRANSPARENT);
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "src/gpu/GrClip.h"
|
||||
#include "src/gpu/GrMemoryPool.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/tessellate/GrPathTessellateOp.h"
|
||||
#include "src/gpu/tessellate/GrWangsFormula.h"
|
||||
|
||||
@ -63,7 +63,7 @@ void TessellatedWedge::onDrawContent(SkCanvas* canvas) {
|
||||
canvas->clear(SK_ColorBLACK);
|
||||
|
||||
auto ctx = canvas->recordingContext();
|
||||
GrRenderTargetContext* rtc = canvas->internal_private_accessTopLayerRenderTargetContext();
|
||||
GrSurfaceDrawContext* rtc = canvas->internal_private_accessTopLayerRenderTargetContext();
|
||||
|
||||
SkString error;
|
||||
if (!rtc || !ctx) {
|
||||
|
@ -24,10 +24,10 @@
|
||||
#include "include/gpu/GrRecordingContext.h"
|
||||
#include "src/gpu/GrFragmentProcessor.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrResourceProvider.h"
|
||||
#include "src/gpu/GrShaderCaps.h"
|
||||
#include "src/gpu/GrStyle.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrTextureProxy.h"
|
||||
#include "src/gpu/effects/GrTextureEffect.h"
|
||||
#include "src/gpu/effects/generated/GrCircleBlurFragmentProcessor.h"
|
||||
@ -56,7 +56,7 @@ public:
|
||||
const SkMatrix& ctm,
|
||||
SkIRect* maskRect) const override;
|
||||
bool directFilterMaskGPU(GrRecordingContext*,
|
||||
GrRenderTargetContext* renderTargetContext,
|
||||
GrSurfaceDrawContext* renderTargetContext,
|
||||
GrPaint&&,
|
||||
const GrClip*,
|
||||
const SkMatrix& viewMatrix,
|
||||
@ -572,7 +572,7 @@ void SkBlurMaskFilterImpl::flatten(SkWriteBuffer& buffer) const {
|
||||
#if SK_SUPPORT_GPU
|
||||
|
||||
bool SkBlurMaskFilterImpl::directFilterMaskGPU(GrRecordingContext* context,
|
||||
GrRenderTargetContext* renderTargetContext,
|
||||
GrSurfaceDrawContext* renderTargetContext,
|
||||
GrPaint&& paint,
|
||||
const GrClip* clip,
|
||||
const SkMatrix& viewMatrix,
|
||||
|
@ -1733,7 +1733,7 @@ SkM44 SkCanvas::getLocalToDevice() const {
|
||||
return fMCRec->fMatrix;
|
||||
}
|
||||
|
||||
GrRenderTargetContext* SkCanvas::internal_private_accessTopLayerRenderTargetContext() {
|
||||
GrSurfaceDrawContext* SkCanvas::internal_private_accessTopLayerRenderTargetContext() {
|
||||
SkBaseDevice* dev = this->getTopDevice();
|
||||
return dev ? dev->accessRenderTargetContext() : nullptr;
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ sk_sp<SkImage> SkDeferredDisplayListRecorder::makeYUVAPromiseTexture(
|
||||
#include "include/gpu/GrYUVABackendTextures.h"
|
||||
#include "src/gpu/GrProxyProvider.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrTexture.h"
|
||||
#include "src/gpu/SkGr.h"
|
||||
#include "src/image/SkImage_Gpu.h"
|
||||
@ -191,10 +191,10 @@ bool SkDeferredDisplayListRecorder::init() {
|
||||
GrSurfaceProxyView readView(fTargetProxy, fCharacterization.origin(), readSwizzle);
|
||||
GrSurfaceProxyView writeView(fTargetProxy, fCharacterization.origin(), writeSwizzle);
|
||||
|
||||
auto rtc = std::make_unique<GrRenderTargetContext>(fContext.get(), std::move(readView),
|
||||
std::move(writeView), grColorType,
|
||||
fCharacterization.refColorSpace(),
|
||||
&fCharacterization.surfaceProps());
|
||||
auto rtc = std::make_unique<GrSurfaceDrawContext>(fContext.get(), std::move(readView),
|
||||
std::move(writeView), grColorType,
|
||||
fCharacterization.refColorSpace(),
|
||||
&fCharacterization.surfaceProps());
|
||||
fSurface = SkSurface_Gpu::MakeWrappedRenderTarget(fContext.get(), std::move(rtc));
|
||||
return SkToBool(fSurface.get());
|
||||
}
|
||||
|
@ -428,7 +428,7 @@ private:
|
||||
/**
|
||||
* Don't call this!
|
||||
*/
|
||||
virtual GrRenderTargetContext* accessRenderTargetContext() { return nullptr; }
|
||||
virtual GrSurfaceDrawContext* accessRenderTargetContext() { return nullptr; }
|
||||
|
||||
// Configure the device's coordinate spaces, specifying both how its device image maps back to
|
||||
// the global space (via 'deviceToGlobal') and the initial CTM of the device (via
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "src/gpu/GrColorInfo.h"
|
||||
#include "src/gpu/GrDirectContextPriv.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/SkGr.h"
|
||||
#include "src/gpu/ops/GrAtlasTextOp.h"
|
||||
#include "src/gpu/text/GrSDFTOptions.h"
|
||||
@ -73,7 +73,7 @@ SkGlyphRunListPainter::SkGlyphRunListPainter(const SkSurfaceProps& props, const
|
||||
compute_scaler_context_flags(csi.colorSpace()),
|
||||
SkStrikeCache::GlobalStrikeCache()) {}
|
||||
|
||||
SkGlyphRunListPainter::SkGlyphRunListPainter(const GrRenderTargetContext& rtc)
|
||||
SkGlyphRunListPainter::SkGlyphRunListPainter(const GrSurfaceDrawContext& rtc)
|
||||
: SkGlyphRunListPainter{rtc.surfaceProps(), rtc.colorInfo()} {}
|
||||
|
||||
#endif
|
||||
|
@ -18,7 +18,7 @@
|
||||
#if SK_SUPPORT_GPU
|
||||
#include "src/gpu/text/GrSDFTOptions.h"
|
||||
class GrColorInfo;
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
#endif
|
||||
|
||||
class SkGlyphRunPainterInterface;
|
||||
@ -62,7 +62,7 @@ public:
|
||||
// The following two ctors are used exclusively by the GPU, and will always use the global
|
||||
// strike cache.
|
||||
SkGlyphRunListPainter(const SkSurfaceProps&, const GrColorInfo&);
|
||||
explicit SkGlyphRunListPainter(const GrRenderTargetContext& renderTargetContext);
|
||||
explicit SkGlyphRunListPainter(const GrSurfaceDrawContext& renderTargetContext);
|
||||
#endif // SK_SUPPORT_GPU
|
||||
|
||||
class BitmapDevicePainter {
|
||||
|
@ -62,7 +62,7 @@ static void fill_in_2D_gaussian_kernel(float* kernel, int width, int height,
|
||||
* Draws 'rtcRect' into 'renderTargetContext' evaluating a 1D Gaussian over 'srcView'. The src rect
|
||||
* is 'rtcRect' offset by 'rtcToSrcOffset'. 'mode' and 'bounds' are applied to the src coords.
|
||||
*/
|
||||
static void convolve_gaussian_1d(GrRenderTargetContext* renderTargetContext,
|
||||
static void convolve_gaussian_1d(GrSurfaceDrawContext* renderTargetContext,
|
||||
GrSurfaceProxyView srcView,
|
||||
const SkIRect srcSubset,
|
||||
SkIVector rtcToSrcOffset,
|
||||
@ -90,22 +90,22 @@ static void convolve_gaussian_1d(GrRenderTargetContext* renderTargetContext,
|
||||
SkRect::Make(rtcRect), SkRect::Make(srcRect));
|
||||
}
|
||||
|
||||
static std::unique_ptr<GrRenderTargetContext> convolve_gaussian_2d(GrRecordingContext* context,
|
||||
GrSurfaceProxyView srcView,
|
||||
GrColorType srcColorType,
|
||||
const SkIRect& srcBounds,
|
||||
const SkIRect& dstBounds,
|
||||
int radiusX,
|
||||
int radiusY,
|
||||
SkScalar sigmaX,
|
||||
SkScalar sigmaY,
|
||||
SkTileMode mode,
|
||||
sk_sp<SkColorSpace> finalCS,
|
||||
SkBackingFit dstFit) {
|
||||
static std::unique_ptr<GrSurfaceDrawContext> convolve_gaussian_2d(GrRecordingContext* context,
|
||||
GrSurfaceProxyView srcView,
|
||||
GrColorType srcColorType,
|
||||
const SkIRect& srcBounds,
|
||||
const SkIRect& dstBounds,
|
||||
int radiusX,
|
||||
int radiusY,
|
||||
SkScalar sigmaX,
|
||||
SkScalar sigmaY,
|
||||
SkTileMode mode,
|
||||
sk_sp<SkColorSpace> finalCS,
|
||||
SkBackingFit dstFit) {
|
||||
SkASSERT(radiusX && radiusY);
|
||||
SkASSERT(!SkGpuBlurUtils::IsEffectivelyZeroSigma(sigmaX) &&
|
||||
!SkGpuBlurUtils::IsEffectivelyZeroSigma(sigmaY));
|
||||
auto renderTargetContext = GrRenderTargetContext::Make(
|
||||
auto renderTargetContext = GrSurfaceDrawContext::Make(
|
||||
context, srcColorType, std::move(finalCS), dstFit, dstBounds.size(), 1,
|
||||
GrMipmapped::kNo, srcView.proxy()->isProtected(), srcView.origin());
|
||||
if (!renderTargetContext) {
|
||||
@ -139,24 +139,24 @@ static std::unique_ptr<GrRenderTargetContext> convolve_gaussian_2d(GrRecordingCo
|
||||
return renderTargetContext;
|
||||
}
|
||||
|
||||
static std::unique_ptr<GrRenderTargetContext> convolve_gaussian(GrRecordingContext* context,
|
||||
GrSurfaceProxyView srcView,
|
||||
GrColorType srcColorType,
|
||||
SkAlphaType srcAlphaType,
|
||||
SkIRect srcBounds,
|
||||
SkIRect dstBounds,
|
||||
Direction direction,
|
||||
int radius,
|
||||
float sigma,
|
||||
SkTileMode mode,
|
||||
sk_sp<SkColorSpace> finalCS,
|
||||
SkBackingFit fit) {
|
||||
static std::unique_ptr<GrSurfaceDrawContext> convolve_gaussian(GrRecordingContext* context,
|
||||
GrSurfaceProxyView srcView,
|
||||
GrColorType srcColorType,
|
||||
SkAlphaType srcAlphaType,
|
||||
SkIRect srcBounds,
|
||||
SkIRect dstBounds,
|
||||
Direction direction,
|
||||
int radius,
|
||||
float sigma,
|
||||
SkTileMode mode,
|
||||
sk_sp<SkColorSpace> finalCS,
|
||||
SkBackingFit fit) {
|
||||
using namespace SkGpuBlurUtils;
|
||||
SkASSERT(radius > 0 && !SkGpuBlurUtils::IsEffectivelyZeroSigma(sigma));
|
||||
// Logically we're creating an infinite blur of 'srcBounds' of 'srcView' with 'mode' tiling
|
||||
// and then capturing the 'dstBounds' portion in a new RTC where the top left of 'dstBounds' is
|
||||
// at {0, 0} in the new RTC.
|
||||
auto dstRenderTargetContext = GrRenderTargetContext::Make(
|
||||
auto dstRenderTargetContext = GrSurfaceDrawContext::Make(
|
||||
context, srcColorType, std::move(finalCS), fit, dstBounds.size(), 1, GrMipmapped::kNo,
|
||||
srcView.proxy()->isProtected(), srcView.origin());
|
||||
if (!dstRenderTargetContext) {
|
||||
@ -288,12 +288,12 @@ static std::unique_ptr<GrRenderTargetContext> convolve_gaussian(GrRecordingConte
|
||||
// Expand the contents of 'srcRenderTargetContext' to fit in 'dstII'. At this point, we are
|
||||
// expanding an intermediate image, so there's no need to account for a proxy offset from the
|
||||
// original input.
|
||||
static std::unique_ptr<GrRenderTargetContext> reexpand(GrRecordingContext* context,
|
||||
std::unique_ptr<GrRenderTargetContext> src,
|
||||
const SkRect& srcBounds,
|
||||
SkISize dstSize,
|
||||
sk_sp<SkColorSpace> colorSpace,
|
||||
SkBackingFit fit) {
|
||||
static std::unique_ptr<GrSurfaceDrawContext> reexpand(GrRecordingContext* context,
|
||||
std::unique_ptr<GrSurfaceDrawContext> src,
|
||||
const SkRect& srcBounds,
|
||||
SkISize dstSize,
|
||||
sk_sp<SkColorSpace> colorSpace,
|
||||
SkBackingFit fit) {
|
||||
GrSurfaceProxyView srcView = src->readSurfaceView();
|
||||
if (!srcView.asTextureProxy()) {
|
||||
return nullptr;
|
||||
@ -304,7 +304,7 @@ static std::unique_ptr<GrRenderTargetContext> reexpand(GrRecordingContext* conte
|
||||
|
||||
src.reset(); // no longer needed
|
||||
|
||||
auto dstRenderTargetContext = GrRenderTargetContext::Make(
|
||||
auto dstRenderTargetContext = GrSurfaceDrawContext::Make(
|
||||
context, srcColorType, std::move(colorSpace), fit, dstSize, 1, GrMipmapped::kNo,
|
||||
srcView.proxy()->isProtected(), srcView.origin());
|
||||
if (!dstRenderTargetContext) {
|
||||
@ -324,21 +324,21 @@ static std::unique_ptr<GrRenderTargetContext> reexpand(GrRecordingContext* conte
|
||||
return dstRenderTargetContext;
|
||||
}
|
||||
|
||||
static std::unique_ptr<GrRenderTargetContext> two_pass_gaussian(GrRecordingContext* context,
|
||||
GrSurfaceProxyView srcView,
|
||||
GrColorType srcColorType,
|
||||
SkAlphaType srcAlphaType,
|
||||
sk_sp<SkColorSpace> colorSpace,
|
||||
SkIRect srcBounds,
|
||||
SkIRect dstBounds,
|
||||
float sigmaX,
|
||||
float sigmaY,
|
||||
int radiusX,
|
||||
int radiusY,
|
||||
SkTileMode mode,
|
||||
SkBackingFit fit) {
|
||||
static std::unique_ptr<GrSurfaceDrawContext> two_pass_gaussian(GrRecordingContext* context,
|
||||
GrSurfaceProxyView srcView,
|
||||
GrColorType srcColorType,
|
||||
SkAlphaType srcAlphaType,
|
||||
sk_sp<SkColorSpace> colorSpace,
|
||||
SkIRect srcBounds,
|
||||
SkIRect dstBounds,
|
||||
float sigmaX,
|
||||
float sigmaY,
|
||||
int radiusX,
|
||||
int radiusY,
|
||||
SkTileMode mode,
|
||||
SkBackingFit fit) {
|
||||
SkASSERT(radiusX || radiusY);
|
||||
std::unique_ptr<GrRenderTargetContext> dstRenderTargetContext;
|
||||
std::unique_ptr<GrSurfaceDrawContext> dstRenderTargetContext;
|
||||
if (radiusX > 0) {
|
||||
SkBackingFit xFit = radiusY > 0 ? SkBackingFit::kApprox : fit;
|
||||
// Expand the dstBounds vertically to produce necessary content for the y-pass. Then we will
|
||||
@ -433,17 +433,17 @@ static std::unique_ptr<GrRenderTargetContext> two_pass_gaussian(GrRecordingConte
|
||||
|
||||
namespace SkGpuBlurUtils {
|
||||
|
||||
std::unique_ptr<GrRenderTargetContext> GaussianBlur(GrRecordingContext* context,
|
||||
GrSurfaceProxyView srcView,
|
||||
GrColorType srcColorType,
|
||||
SkAlphaType srcAlphaType,
|
||||
sk_sp<SkColorSpace> colorSpace,
|
||||
SkIRect dstBounds,
|
||||
SkIRect srcBounds,
|
||||
float sigmaX,
|
||||
float sigmaY,
|
||||
SkTileMode mode,
|
||||
SkBackingFit fit) {
|
||||
std::unique_ptr<GrSurfaceDrawContext> GaussianBlur(GrRecordingContext* context,
|
||||
GrSurfaceProxyView srcView,
|
||||
GrColorType srcColorType,
|
||||
SkAlphaType srcAlphaType,
|
||||
sk_sp<SkColorSpace> colorSpace,
|
||||
SkIRect dstBounds,
|
||||
SkIRect srcBounds,
|
||||
float sigmaX,
|
||||
float sigmaY,
|
||||
SkTileMode mode,
|
||||
SkBackingFit fit) {
|
||||
SkASSERT(context);
|
||||
TRACE_EVENT2("skia.gpu", "GaussianBlur", "sigmaX", sigmaX, "sigmaY", sigmaY);
|
||||
|
||||
@ -501,7 +501,7 @@ std::unique_ptr<GrRenderTargetContext> GaussianBlur(GrRecordingContext* context,
|
||||
// If we determined that there is no blurring necessary in either direction then just do a
|
||||
// a draw that applies the tile mode.
|
||||
if (!radiusX && !radiusY) {
|
||||
auto result = GrRenderTargetContext::Make(context, srcColorType, std::move(colorSpace), fit,
|
||||
auto result = GrSurfaceDrawContext::Make(context, srcColorType, std::move(colorSpace), fit,
|
||||
dstBounds.size(), 1, GrMipmapped::kNo,
|
||||
srcView.proxy()->isProtected(), srcView.origin());
|
||||
GrSamplerState sampler(SkTileModeToWrapMode(mode), GrSamplerState::Filter::kNearest);
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "include/core/SkTypes.h"
|
||||
|
||||
#if SK_SUPPORT_GPU
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
|
||||
class GrRecordingContext;
|
||||
class GrTexture;
|
||||
@ -41,17 +41,17 @@ namespace SkGpuBlurUtils {
|
||||
* @param fit backing fit for the returned render target context
|
||||
* @return The renderTargetContext containing the blurred result.
|
||||
*/
|
||||
std::unique_ptr<GrRenderTargetContext> GaussianBlur(GrRecordingContext* context,
|
||||
GrSurfaceProxyView srcView,
|
||||
GrColorType srcColorType,
|
||||
SkAlphaType srcAlphaType,
|
||||
sk_sp<SkColorSpace> colorSpace,
|
||||
SkIRect dstBounds,
|
||||
SkIRect srcBounds,
|
||||
float sigmaX,
|
||||
float sigmaY,
|
||||
SkTileMode mode,
|
||||
SkBackingFit fit = SkBackingFit::kApprox);
|
||||
std::unique_ptr<GrSurfaceDrawContext> GaussianBlur(GrRecordingContext* context,
|
||||
GrSurfaceProxyView srcView,
|
||||
GrColorType srcColorType,
|
||||
SkAlphaType srcAlphaType,
|
||||
sk_sp<SkColorSpace> colorSpace,
|
||||
SkIRect dstBounds,
|
||||
SkIRect srcBounds,
|
||||
float sigmaX,
|
||||
float sigmaY,
|
||||
SkTileMode mode,
|
||||
SkBackingFit fit = SkBackingFit::kApprox);
|
||||
|
||||
static const int kBlurRRectMaxDivisions = 6;
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "src/gpu/GrColorSpaceXform.h"
|
||||
#include "src/gpu/GrDirectContextPriv.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrTextureProxy.h"
|
||||
#include "src/gpu/SkGr.h"
|
||||
#endif
|
||||
@ -595,7 +595,7 @@ sk_sp<SkSpecialImage> SkImageFilter_Base::DrawWithFP(GrRecordingContext* context
|
||||
paint.setColorFragmentProcessor(std::move(fp));
|
||||
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
|
||||
|
||||
auto renderTargetContext = GrRenderTargetContext::Make(
|
||||
auto renderTargetContext = GrSurfaceDrawContext::Make(
|
||||
context, SkColorTypeToGrColorType(colorType), sk_ref_sp(colorSpace),
|
||||
SkBackingFit::kApprox, bounds.size(), 1, GrMipmapped::kNo, isProtected,
|
||||
kBottomLeft_GrSurfaceOrigin);
|
||||
|
@ -335,7 +335,7 @@ bool SkMaskFilterBase::canFilterMaskGPU(const GrStyledShape& shape,
|
||||
}
|
||||
|
||||
bool SkMaskFilterBase::directFilterMaskGPU(GrRecordingContext*,
|
||||
GrRenderTargetContext*,
|
||||
GrSurfaceDrawContext*,
|
||||
GrPaint&&,
|
||||
const GrClip*,
|
||||
const SkMatrix& viewMatrix,
|
||||
|
@ -26,7 +26,7 @@ class GrFragmentProcessor;
|
||||
class GrPaint;
|
||||
class GrRecordingContext;
|
||||
class GrRenderTarget;
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
class GrResourceProvider;
|
||||
class GrStyledShape;
|
||||
class GrSurfaceProxyView;
|
||||
@ -114,7 +114,7 @@ public:
|
||||
* successful. If false is returned then paint is unmodified.
|
||||
*/
|
||||
virtual bool directFilterMaskGPU(GrRecordingContext*,
|
||||
GrRenderTargetContext*,
|
||||
GrSurfaceDrawContext*,
|
||||
GrPaint&& paint,
|
||||
const GrClip*,
|
||||
const SkMatrix& viewMatrix,
|
||||
|
@ -125,7 +125,7 @@ sk_sp<SkSpecialSurface> SkSpecialSurface::MakeRaster(const SkImageInfo& info,
|
||||
class SkSpecialSurface_Gpu : public SkSpecialSurface_Base {
|
||||
public:
|
||||
SkSpecialSurface_Gpu(GrRecordingContext* context,
|
||||
std::unique_ptr<GrRenderTargetContext> renderTargetContext,
|
||||
std::unique_ptr<GrSurfaceDrawContext> renderTargetContext,
|
||||
int width, int height, const SkIRect& subset)
|
||||
: INHERITED(subset, &renderTargetContext->surfaceProps())
|
||||
, fReadView(renderTargetContext->readSurfaceView()) {
|
||||
@ -171,7 +171,7 @@ sk_sp<SkSpecialSurface> SkSpecialSurface::MakeRenderTarget(GrRecordingContext* c
|
||||
if (!context) {
|
||||
return nullptr;
|
||||
}
|
||||
auto renderTargetContext = GrRenderTargetContext::Make(
|
||||
auto renderTargetContext = GrSurfaceDrawContext::Make(
|
||||
context, colorType, std::move(colorSpace), SkBackingFit::kApprox, {width, height}, 1,
|
||||
GrMipmapped::kNo, GrProtected::kNo, kBottomLeft_GrSurfaceOrigin, SkBudgeted::kYes,
|
||||
props);
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "src/gpu/GrCaps.h"
|
||||
#include "src/gpu/GrColorSpaceXform.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrTextureProxy.h"
|
||||
#include "src/gpu/effects/GrTextureEffect.h"
|
||||
#include "src/gpu/effects/generated/GrAlphaThresholdFragmentProcessor.h"
|
||||
@ -102,7 +102,7 @@ void SkAlphaThresholdFilterImpl::flatten(SkWriteBuffer& buffer) const {
|
||||
GrSurfaceProxyView SkAlphaThresholdFilterImpl::createMaskTexture(GrRecordingContext* context,
|
||||
const SkMatrix& inMatrix,
|
||||
const SkIRect& bounds) const {
|
||||
auto rtContext = GrRenderTargetContext::MakeWithFallback(
|
||||
auto rtContext = GrSurfaceDrawContext::MakeWithFallback(
|
||||
context, GrColorType::kAlpha_8, nullptr, SkBackingFit::kApprox, bounds.size());
|
||||
if (!rtContext) {
|
||||
return {};
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "include/gpu/GrRecordingContext.h"
|
||||
#include "src/gpu/GrColorSpaceXform.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrTextureProxy.h"
|
||||
#include "src/gpu/SkGr.h"
|
||||
#include "src/gpu/effects/generated/GrArithmeticProcessor.h"
|
||||
@ -369,7 +369,7 @@ sk_sp<SkSpecialImage> ArithmeticImageFilterImpl::filterImageGPU(
|
||||
|
||||
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
|
||||
|
||||
auto renderTargetContext = GrRenderTargetContext::Make(
|
||||
auto renderTargetContext = GrSurfaceDrawContext::Make(
|
||||
context, ctx.grColorType(), ctx.refColorSpace(), SkBackingFit::kApprox, bounds.size(),
|
||||
1, GrMipmapped::kNo, isProtected, kBottomLeft_GrSurfaceOrigin);
|
||||
if (!renderTargetContext) {
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "src/gpu/GrCaps.h"
|
||||
#include "src/gpu/GrColorSpaceXform.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrTexture.h"
|
||||
#include "src/gpu/GrTextureProxy.h"
|
||||
#include "src/gpu/SkGr.h"
|
||||
@ -347,7 +347,7 @@ sk_sp<SkSpecialImage> SkDisplacementMapEffectImpl::onFilterImage(const Context&
|
||||
SkMatrix matrix;
|
||||
matrix.setTranslate(-SkIntToScalar(colorBounds.x()), -SkIntToScalar(colorBounds.y()));
|
||||
|
||||
auto renderTargetContext = GrRenderTargetContext::Make(
|
||||
auto renderTargetContext = GrSurfaceDrawContext::Make(
|
||||
context, ctx.grColorType(), ctx.refColorSpace(), SkBackingFit::kApprox,
|
||||
bounds.size(), 1, GrMipmapped::kNo, isProtected, kBottomLeft_GrSurfaceOrigin);
|
||||
if (!renderTargetContext) {
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "src/gpu/GrFragmentProcessor.h"
|
||||
#include "src/gpu/GrPaint.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrTexture.h"
|
||||
#include "src/gpu/GrTextureProxy.h"
|
||||
|
||||
@ -441,7 +441,7 @@ protected:
|
||||
|
||||
private:
|
||||
#if SK_SUPPORT_GPU
|
||||
void drawRect(GrRenderTargetContext*,
|
||||
void drawRect(GrSurfaceDrawContext*,
|
||||
GrSurfaceProxyView srcView,
|
||||
const SkMatrix& matrix,
|
||||
const SkRect& dstRect,
|
||||
@ -457,7 +457,7 @@ private:
|
||||
};
|
||||
|
||||
#if SK_SUPPORT_GPU
|
||||
void SkLightingImageFilterInternal::drawRect(GrRenderTargetContext* renderTargetContext,
|
||||
void SkLightingImageFilterInternal::drawRect(GrSurfaceDrawContext* renderTargetContext,
|
||||
GrSurfaceProxyView srcView,
|
||||
const SkMatrix& matrix,
|
||||
const SkRect& dstRect,
|
||||
@ -486,7 +486,7 @@ sk_sp<SkSpecialImage> SkLightingImageFilterInternal::filterImageGPU(
|
||||
GrSurfaceProxyView inputView = input->view(context);
|
||||
SkASSERT(inputView.asTextureProxy());
|
||||
|
||||
auto renderTargetContext = GrRenderTargetContext::Make(
|
||||
auto renderTargetContext = GrSurfaceDrawContext::Make(
|
||||
context, ctx.grColorType(), ctx.refColorSpace(), SkBackingFit::kApprox,
|
||||
offsetBounds.size(), 1, GrMipmapped::kNo, inputView.proxy()->isProtected(),
|
||||
kBottomLeft_GrSurfaceOrigin);
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "include/gpu/GrRecordingContext.h"
|
||||
#include "src/gpu/GrDirectContextPriv.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrTexture.h"
|
||||
#include "src/gpu/GrTextureProxy.h"
|
||||
#include "src/gpu/SkGr.h"
|
||||
@ -362,7 +362,7 @@ std::unique_ptr<GrFragmentProcessor> GrMorphologyEffect::TestCreate(GrProcessorT
|
||||
}
|
||||
#endif
|
||||
|
||||
static void apply_morphology_rect(GrRenderTargetContext* renderTargetContext,
|
||||
static void apply_morphology_rect(GrSurfaceDrawContext* renderTargetContext,
|
||||
GrSurfaceProxyView view,
|
||||
SkAlphaType srcAlphaType,
|
||||
const SkIRect& srcRect,
|
||||
@ -381,7 +381,7 @@ static void apply_morphology_rect(GrRenderTargetContext* renderTargetContext,
|
||||
SkRect::Make(srcRect));
|
||||
}
|
||||
|
||||
static void apply_morphology_rect_no_bounds(GrRenderTargetContext* renderTargetContext,
|
||||
static void apply_morphology_rect_no_bounds(GrSurfaceDrawContext* renderTargetContext,
|
||||
GrSurfaceProxyView view,
|
||||
SkAlphaType srcAlphaType,
|
||||
const SkIRect& srcRect,
|
||||
@ -398,7 +398,7 @@ static void apply_morphology_rect_no_bounds(GrRenderTargetContext* renderTargetC
|
||||
SkRect::Make(srcRect));
|
||||
}
|
||||
|
||||
static void apply_morphology_pass(GrRenderTargetContext* renderTargetContext,
|
||||
static void apply_morphology_pass(GrSurfaceDrawContext* renderTargetContext,
|
||||
GrSurfaceProxyView view,
|
||||
SkAlphaType srcAlphaType,
|
||||
const SkIRect& srcRect,
|
||||
@ -462,7 +462,7 @@ static sk_sp<SkSpecialImage> apply_morphology(
|
||||
SkASSERT(radius.width() > 0 || radius.height() > 0);
|
||||
|
||||
if (radius.fWidth > 0) {
|
||||
auto dstRTContext = GrRenderTargetContext::Make(
|
||||
auto dstRTContext = GrSurfaceDrawContext::Make(
|
||||
context, colorType, colorSpace, SkBackingFit::kApprox, rect.size(), 1,
|
||||
GrMipmapped::kNo, proxy->isProtected(), kBottomLeft_GrSurfaceOrigin);
|
||||
if (!dstRTContext) {
|
||||
@ -482,7 +482,7 @@ static sk_sp<SkSpecialImage> apply_morphology(
|
||||
srcRect = dstRect;
|
||||
}
|
||||
if (radius.fHeight > 0) {
|
||||
auto dstRTContext = GrRenderTargetContext::Make(
|
||||
auto dstRTContext = GrSurfaceDrawContext::Make(
|
||||
context, colorType, colorSpace, SkBackingFit::kApprox, rect.size(), 1,
|
||||
GrMipmapped::kNo, srcView.proxy()->isProtected(), kBottomLeft_GrSurfaceOrigin);
|
||||
if (!dstRTContext) {
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "src/gpu/GrCaps.h"
|
||||
#include "src/gpu/GrColorSpaceXform.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrTextureProxy.h"
|
||||
#include "src/gpu/SkGr.h"
|
||||
#include "src/gpu/effects/GrTextureEffect.h"
|
||||
@ -287,7 +287,7 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilterImpl::filterImageGPU(
|
||||
paint.setColorFragmentProcessor(std::move(fp));
|
||||
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
|
||||
|
||||
auto renderTargetContext = GrRenderTargetContext::Make(
|
||||
auto renderTargetContext = GrSurfaceDrawContext::Make(
|
||||
context, ctx.grColorType(), ctx.refColorSpace(), SkBackingFit::kApprox, bounds.size());
|
||||
if (!renderTargetContext) {
|
||||
return nullptr;
|
||||
|
@ -13,11 +13,11 @@
|
||||
#include "src/gpu/GrGpu.h"
|
||||
#include "src/gpu/GrProxyProvider.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrResourceCache.h"
|
||||
#include "src/gpu/GrResourceProvider.h"
|
||||
#include "src/gpu/GrResourceProviderPriv.h"
|
||||
#include "src/gpu/GrSemaphore.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrTexture.h"
|
||||
#include "src/gpu/GrTextureProxyPriv.h"
|
||||
#include "src/gpu/SkGr.h"
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
#include "include/core/SkImageGenerator.h"
|
||||
#include "include/gpu/GrBackendSurface.h"
|
||||
#include "include/gpu/GrRecordingContext.h"
|
||||
#include "include/private/GrResourceKey.h"
|
||||
#include "include/private/SkMutex.h"
|
||||
#include "src/gpu/GrTexture.h"
|
||||
|
@ -15,9 +15,9 @@
|
||||
#include "src/gpu/GrFixedClip.h"
|
||||
#include "src/gpu/GrProxyProvider.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSoftwarePathRenderer.h"
|
||||
#include "src/gpu/GrStyle.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrTextureProxy.h"
|
||||
#include "src/gpu/GrThreadSafeCache.h"
|
||||
#include "src/gpu/effects/GrTextureEffect.h"
|
||||
@ -39,7 +39,7 @@ static constexpr auto kMaskOrigin = kTopLeft_GrSurfaceOrigin;
|
||||
// Draw a mask using the supplied paint. Since the coverage/geometry
|
||||
// is already burnt into the mask this boils down to a rect draw.
|
||||
// Return true if the mask was successfully drawn.
|
||||
static bool draw_mask(GrRenderTargetContext* renderTargetContext,
|
||||
static bool draw_mask(GrSurfaceDrawContext* renderTargetContext,
|
||||
const GrClip* clip,
|
||||
const SkMatrix& viewMatrix,
|
||||
const SkIRect& maskRect,
|
||||
@ -178,11 +178,11 @@ static GrSurfaceProxyView sw_create_filtered_mask(GrRecordingContext* rContext,
|
||||
}
|
||||
|
||||
// Create a mask of 'shape' and return the resulting renderTargetContext
|
||||
static std::unique_ptr<GrRenderTargetContext> create_mask_GPU(GrRecordingContext* context,
|
||||
const SkIRect& maskRect,
|
||||
const SkMatrix& origViewMatrix,
|
||||
const GrStyledShape& shape,
|
||||
int sampleCnt) {
|
||||
static std::unique_ptr<GrSurfaceDrawContext> create_mask_GPU(GrRecordingContext* context,
|
||||
const SkIRect& maskRect,
|
||||
const SkMatrix& origViewMatrix,
|
||||
const GrStyledShape& shape,
|
||||
int sampleCnt) {
|
||||
// Use GrResourceProvider::MakeApprox to implement our own approximate size matching, but demand
|
||||
// a "SkBackingFit::kExact" size match on the actual render target. We do this because the
|
||||
// filter will reach outside the src bounds, so we need to pre-clear these values to ensure a
|
||||
@ -193,7 +193,7 @@ static std::unique_ptr<GrRenderTargetContext> create_mask_GPU(GrRecordingContext
|
||||
// the same. We should offset our filter within the render target and expand the size as needed
|
||||
// to guarantee at least 1px of padding on all sides.
|
||||
auto approxSize = GrResourceProvider::MakeApprox(maskRect.size());
|
||||
auto rtContext = GrRenderTargetContext::MakeWithFallback(
|
||||
auto rtContext = GrSurfaceDrawContext::MakeWithFallback(
|
||||
context, GrColorType::kAlpha_8, nullptr, SkBackingFit::kExact, approxSize, sampleCnt,
|
||||
GrMipmapped::kNo, GrProtected::kNo, kMaskOrigin);
|
||||
if (!rtContext) {
|
||||
@ -243,7 +243,7 @@ static bool get_unclipped_shape_dev_bounds(const GrStyledShape& shape, const SkM
|
||||
|
||||
// Gets the shape bounds, the clip bounds, and the intersection (if any). Returns false if there
|
||||
// is no intersection.
|
||||
static bool get_shape_and_clip_bounds(GrRenderTargetContext* renderTargetContext,
|
||||
static bool get_shape_and_clip_bounds(GrSurfaceDrawContext* renderTargetContext,
|
||||
const GrClip* clip,
|
||||
const GrStyledShape& shape,
|
||||
const SkMatrix& matrix,
|
||||
@ -350,7 +350,7 @@ static bool compute_key_and_clip_bounds(GrUniqueKey* maskKey,
|
||||
}
|
||||
|
||||
static GrSurfaceProxyView hw_create_filtered_mask(GrDirectContext* dContext,
|
||||
GrRenderTargetContext* renderTargetContext,
|
||||
GrSurfaceDrawContext* renderTargetContext,
|
||||
const SkMatrix& viewMatrix,
|
||||
const GrStyledShape& shape,
|
||||
const SkMaskFilterBase* filter,
|
||||
@ -399,7 +399,7 @@ static GrSurfaceProxyView hw_create_filtered_mask(GrDirectContext* dContext,
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<GrRenderTargetContext> maskRTC(create_mask_GPU(
|
||||
std::unique_ptr<GrSurfaceDrawContext> maskRTC(create_mask_GPU(
|
||||
dContext,
|
||||
*maskRect,
|
||||
viewMatrix,
|
||||
@ -445,7 +445,7 @@ static GrSurfaceProxyView hw_create_filtered_mask(GrDirectContext* dContext,
|
||||
}
|
||||
|
||||
static void draw_shape_with_mask_filter(GrRecordingContext* rContext,
|
||||
GrRenderTargetContext* renderTargetContext,
|
||||
GrSurfaceDrawContext* renderTargetContext,
|
||||
const GrClip* clip,
|
||||
GrPaint&& paint,
|
||||
const SkMatrix& viewMatrix,
|
||||
@ -536,7 +536,7 @@ static void draw_shape_with_mask_filter(GrRecordingContext* rContext,
|
||||
}
|
||||
|
||||
void GrBlurUtils::drawShapeWithMaskFilter(GrRecordingContext* context,
|
||||
GrRenderTargetContext* renderTargetContext,
|
||||
GrSurfaceDrawContext* renderTargetContext,
|
||||
const GrClip* clip,
|
||||
const GrStyledShape& shape,
|
||||
GrPaint&& paint,
|
||||
@ -547,7 +547,7 @@ void GrBlurUtils::drawShapeWithMaskFilter(GrRecordingContext* context,
|
||||
}
|
||||
|
||||
void GrBlurUtils::drawShapeWithMaskFilter(GrRecordingContext* context,
|
||||
GrRenderTargetContext* renderTargetContext,
|
||||
GrSurfaceDrawContext* renderTargetContext,
|
||||
const GrClip* clip,
|
||||
const SkPaint& paint,
|
||||
const SkMatrixProvider& matrixProvider,
|
||||
|
@ -14,7 +14,7 @@ class GrClip;
|
||||
class GrPaint;
|
||||
class GrRecordingContext;
|
||||
class GrRenderTarget;
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
class GrStyledShape;
|
||||
class GrStyle;
|
||||
struct SkIRect;
|
||||
@ -34,7 +34,7 @@ namespace GrBlurUtils {
|
||||
* Draw a shape handling the mask filter if present.
|
||||
*/
|
||||
void drawShapeWithMaskFilter(GrRecordingContext*,
|
||||
GrRenderTargetContext*,
|
||||
GrSurfaceDrawContext*,
|
||||
const GrClip*,
|
||||
const SkPaint&,
|
||||
const SkMatrixProvider&,
|
||||
@ -45,7 +45,7 @@ namespace GrBlurUtils {
|
||||
* The GrPaint will be modified after return.
|
||||
*/
|
||||
void drawShapeWithMaskFilter(GrRecordingContext*,
|
||||
GrRenderTargetContext*,
|
||||
GrSurfaceDrawContext*,
|
||||
const GrClip*,
|
||||
const GrStyledShape&,
|
||||
GrPaint&&,
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "include/core/SkRRect.h"
|
||||
#include "include/core/SkRect.h"
|
||||
#include "src/gpu/GrAppliedClip.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
|
||||
/**
|
||||
* GrClip is an abstract base class for applying a clip. It constructs a clip mask if necessary, and
|
||||
@ -62,7 +62,7 @@ public:
|
||||
* clips). If kNoDraw is returned, 'bounds' and the applied clip are in an undetermined state
|
||||
* and should be ignored (and the draw should be skipped).
|
||||
*/
|
||||
virtual Effect apply(GrRecordingContext*, GrRenderTargetContext*, GrAAType,
|
||||
virtual Effect apply(GrRecordingContext*, GrSurfaceDrawContext*, GrAAType,
|
||||
bool hasUserStencilSettings, GrAppliedClip*, SkRect* bounds) const = 0;
|
||||
|
||||
/**
|
||||
@ -243,7 +243,7 @@ public:
|
||||
virtual Effect apply(GrAppliedHardClip* out, SkIRect* bounds) const = 0;
|
||||
|
||||
private:
|
||||
Effect apply(GrRecordingContext*, GrRenderTargetContext* rtc, GrAAType aa,
|
||||
Effect apply(GrRecordingContext*, GrSurfaceDrawContext* rtc, GrAAType aa,
|
||||
bool hasUserStencilSettings, GrAppliedClip* out, SkRect* bounds) const final {
|
||||
SkIRect pixelBounds = GetPixelIBounds(*bounds, GrAA(aa != GrAAType::kNone));
|
||||
Effect effect = this->apply(&out->hardClip(), &pixelBounds);
|
||||
|
@ -375,7 +375,7 @@ static GrSurfaceProxyView render_sw_mask(GrRecordingContext* context, const SkIR
|
||||
}
|
||||
}
|
||||
|
||||
static void render_stencil_mask(GrRecordingContext* context, GrRenderTargetContext* rtc,
|
||||
static void render_stencil_mask(GrRecordingContext* context, GrSurfaceDrawContext* rtc,
|
||||
uint32_t genID, const SkIRect& bounds,
|
||||
const GrClipStack::Element** elements, int count,
|
||||
GrAppliedClip* out) {
|
||||
@ -1255,7 +1255,7 @@ GrClip::PreClipResult GrClipStack::preApply(const SkRect& bounds, GrAA aa) const
|
||||
SkUNREACHABLE;
|
||||
}
|
||||
|
||||
GrClip::Effect GrClipStack::apply(GrRecordingContext* context, GrRenderTargetContext* rtc,
|
||||
GrClip::Effect GrClipStack::apply(GrRecordingContext* context, GrSurfaceDrawContext* rtc,
|
||||
GrAAType aa, bool hasUserStencilSettings,
|
||||
GrAppliedClip* out, SkRect* bounds) const {
|
||||
// TODO: Once we no longer store SW masks, we don't need to sneak the provider in like this
|
||||
|
@ -20,7 +20,7 @@
|
||||
class GrAppliedClip;
|
||||
class GrProxyProvider;
|
||||
class GrRecordingContext;
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
class GrSWMaskHelper;
|
||||
|
||||
class GrClipStack final : public GrClip {
|
||||
@ -71,7 +71,7 @@ public:
|
||||
void replaceClip(const SkIRect& rect);
|
||||
|
||||
// GrClip implementation
|
||||
GrClip::Effect apply(GrRecordingContext*, GrRenderTargetContext*, GrAAType aa,
|
||||
GrClip::Effect apply(GrRecordingContext*, GrSurfaceDrawContext*, GrAAType aa,
|
||||
bool hasUserStencilSettings,
|
||||
GrAppliedClip*, SkRect* bounds) const override;
|
||||
GrClip::PreClipResult preApply(const SkRect& drawBounds, GrAA aa) const override;
|
||||
|
@ -90,7 +90,7 @@ static std::unique_ptr<GrFragmentProcessor> create_fp_for_mask(GrSurfaceProxyVie
|
||||
bool GrClipStackClip::PathNeedsSWRenderer(GrRecordingContext* context,
|
||||
const SkIRect& scissorRect,
|
||||
bool hasUserStencilSettings,
|
||||
const GrRenderTargetContext* renderTargetContext,
|
||||
const GrSurfaceDrawContext* renderTargetContext,
|
||||
const SkMatrix& viewMatrix,
|
||||
const Element* element,
|
||||
bool needsStencil) {
|
||||
@ -144,7 +144,7 @@ bool GrClipStackClip::PathNeedsSWRenderer(GrRecordingContext* context,
|
||||
*/
|
||||
bool GrClipStackClip::UseSWOnlyPath(GrRecordingContext* context,
|
||||
bool hasUserStencilSettings,
|
||||
const GrRenderTargetContext* renderTargetContext,
|
||||
const GrSurfaceDrawContext* renderTargetContext,
|
||||
const GrReducedClip& reducedClip) {
|
||||
// TODO: right now it appears that GPU clip masks are strictly slower than software. We may
|
||||
// want to revisit this assumption once we can test with render target sorting.
|
||||
@ -186,7 +186,7 @@ bool GrClipStackClip::UseSWOnlyPath(GrRecordingContext* context,
|
||||
// sort out what kind of clip mask needs to be created: alpha, stencil,
|
||||
// scissor, or entirely software
|
||||
GrClip::Effect GrClipStackClip::apply(GrRecordingContext* context,
|
||||
GrRenderTargetContext* renderTargetContext,
|
||||
GrSurfaceDrawContext* renderTargetContext,
|
||||
GrAAType aa, bool hasUserStencilSettings,
|
||||
GrAppliedClip* out, SkRect* bounds) const {
|
||||
SkASSERT(renderTargetContext->width() == fDeviceSize.fWidth &&
|
||||
@ -258,7 +258,7 @@ GrClip::Effect GrClipStackClip::apply(GrRecordingContext* context,
|
||||
}
|
||||
|
||||
bool GrClipStackClip::applyClipMask(GrRecordingContext* context,
|
||||
GrRenderTargetContext* renderTargetContext,
|
||||
GrSurfaceDrawContext* renderTargetContext,
|
||||
const GrReducedClip& reducedClip, bool hasUserStencilSettings,
|
||||
GrAppliedClip* out) const {
|
||||
#ifdef SK_DEBUG
|
||||
@ -353,7 +353,7 @@ GrSurfaceProxyView GrClipStackClip::createAlphaClipMask(GrRecordingContext* cont
|
||||
return cachedView;
|
||||
}
|
||||
|
||||
auto rtc = GrRenderTargetContext::MakeWithFallback(
|
||||
auto rtc = GrSurfaceDrawContext::MakeWithFallback(
|
||||
context, GrColorType::kAlpha_8, nullptr, SkBackingFit::kApprox,
|
||||
{reducedClip.width(), reducedClip.height()}, 1, GrMipmapped::kNo, GrProtected::kNo,
|
||||
kMaskOrigin);
|
||||
@ -453,7 +453,7 @@ static void draw_clip_elements_to_mask_helper(GrSWMaskHelper& helper, const Elem
|
||||
|
||||
GrSurfaceProxyView GrClipStackClip::createSoftwareClipMask(
|
||||
GrRecordingContext* context, const GrReducedClip& reducedClip,
|
||||
GrRenderTargetContext* renderTargetContext) const {
|
||||
GrSurfaceDrawContext* renderTargetContext) const {
|
||||
GrUniqueKey key;
|
||||
create_clip_mask_key(reducedClip.maskGenID(), reducedClip.scissor(),
|
||||
reducedClip.numAnalyticElements(), &key);
|
||||
|
@ -28,7 +28,7 @@ public:
|
||||
, fMatrixProvider(matrixProvider) {}
|
||||
|
||||
SkIRect getConservativeBounds() const final;
|
||||
Effect apply(GrRecordingContext*, GrRenderTargetContext*, GrAAType aaType,
|
||||
Effect apply(GrRecordingContext*, GrSurfaceDrawContext*, GrAAType aaType,
|
||||
bool hasUserStencilSettings, GrAppliedClip* out, SkRect* bounds) const final;
|
||||
PreClipResult preApply(const SkRect& drawBounds, GrAA aa) const final;
|
||||
|
||||
@ -39,12 +39,12 @@ private:
|
||||
static bool PathNeedsSWRenderer(GrRecordingContext* context,
|
||||
const SkIRect& scissorRect,
|
||||
bool hasUserStencilSettings,
|
||||
const GrRenderTargetContext*,
|
||||
const GrSurfaceDrawContext*,
|
||||
const SkMatrix& viewMatrix,
|
||||
const SkClipStack::Element* element,
|
||||
bool needsStencil);
|
||||
|
||||
bool applyClipMask(GrRecordingContext*, GrRenderTargetContext*, const GrReducedClip&,
|
||||
bool applyClipMask(GrRecordingContext*, GrSurfaceDrawContext*, const GrReducedClip&,
|
||||
bool hasUserStencilSettings, GrAppliedClip*) const;
|
||||
|
||||
// Creates an alpha mask of the clip. The mask is a rasterization of elements through the
|
||||
@ -53,11 +53,11 @@ private:
|
||||
|
||||
// Similar to createAlphaClipMask but it rasterizes in SW and uploads to the result texture.
|
||||
GrSurfaceProxyView createSoftwareClipMask(GrRecordingContext*, const GrReducedClip&,
|
||||
GrRenderTargetContext*) const;
|
||||
GrSurfaceDrawContext*) const;
|
||||
|
||||
static bool UseSWOnlyPath(GrRecordingContext*,
|
||||
bool hasUserStencilSettings,
|
||||
const GrRenderTargetContext*,
|
||||
const GrSurfaceDrawContext*,
|
||||
const GrReducedClip&);
|
||||
|
||||
// SkClipStack does not track device bounds explicitly, but it will refine these device bounds
|
||||
|
@ -14,8 +14,8 @@
|
||||
#include "src/gpu/GrDrawingManager.h"
|
||||
#include "src/gpu/GrGpu.h"
|
||||
#include "src/gpu/GrMemoryPool.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrTexture.h"
|
||||
#include "src/gpu/SkGr.h"
|
||||
#include "src/gpu/effects/GrSkSLFP.h"
|
||||
|
@ -17,12 +17,12 @@ class GrContext_Base;
|
||||
class GrDrawOp;
|
||||
class GrPaint;
|
||||
class GrRecordingContext;
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
struct GrUserStencilSettings;
|
||||
class SkRandom;
|
||||
|
||||
/** This function draws a randomly configured GrDrawOp for testing purposes. */
|
||||
void GrDrawRandomOp(SkRandom*, GrRenderTargetContext*, GrPaint&&);
|
||||
void GrDrawRandomOp(SkRandom*, GrSurfaceDrawContext*, GrPaint&&);
|
||||
|
||||
/** GrDrawOp subclasses should define test factory functions using this macro. */
|
||||
#define GR_DRAW_OP_TEST_DEFINE(Op) \
|
||||
|
@ -24,13 +24,13 @@
|
||||
#include "src/gpu/GrMemoryPool.h"
|
||||
#include "src/gpu/GrOnFlushResourceProvider.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrRenderTargetProxy.h"
|
||||
#include "src/gpu/GrRenderTask.h"
|
||||
#include "src/gpu/GrResourceAllocator.h"
|
||||
#include "src/gpu/GrResourceProvider.h"
|
||||
#include "src/gpu/GrSoftwarePathRenderer.h"
|
||||
#include "src/gpu/GrSurfaceContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrSurfaceProxyPriv.h"
|
||||
#include "src/gpu/GrTTopoSort.h"
|
||||
#include "src/gpu/GrTexture.h"
|
||||
|
@ -29,7 +29,7 @@ class GrOnFlushCallbackObject;
|
||||
class GrOpFlushState;
|
||||
class GrOpsTask;
|
||||
class GrRecordingContext;
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
class GrRenderTargetProxy;
|
||||
class GrRenderTask;
|
||||
class GrSemaphore;
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "src/gpu/GrRectanizerPow2.h"
|
||||
#include "src/gpu/GrRectanizerSkyline.h"
|
||||
#include "src/gpu/GrRenderTarget.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
|
||||
// Each Node covers a sub-rectangle of the final atlas. When a GrDynamicAtlas runs out of room, we
|
||||
// create a new Node the same size as all combined nodes in the atlas as-is, and then place the new
|
||||
@ -166,7 +166,7 @@ bool GrDynamicAtlas::internalPlaceRect(int w, int h, SkIPoint16* loc) {
|
||||
return true;
|
||||
}
|
||||
|
||||
std::unique_ptr<GrRenderTargetContext> GrDynamicAtlas::instantiate(
|
||||
std::unique_ptr<GrSurfaceDrawContext> GrDynamicAtlas::instantiate(
|
||||
GrOnFlushResourceProvider* onFlushRP, sk_sp<GrTexture> backingTexture) {
|
||||
SkASSERT(!this->isInstantiated()); // This method should only be called once.
|
||||
// Caller should have cropped any paths to the destination render target instead of asking for
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "src/gpu/GrTextureProxy.h"
|
||||
|
||||
class GrOnFlushResourceProvider;
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
class GrResourceProvider;
|
||||
struct SkIPoint16;
|
||||
struct SkIRect;
|
||||
@ -65,14 +65,14 @@ public:
|
||||
bool addRect(int width, int height, SkIPoint16* location);
|
||||
const SkISize& drawBounds() { return fDrawBounds; }
|
||||
|
||||
// Instantiates our texture proxy for the atlas and returns a pre-cleared GrRenderTargetContext
|
||||
// Instantiates our texture proxy for the atlas and returns a pre-cleared GrSurfaceDrawContext
|
||||
// that the caller may use to render the content. After this call, it is no longer valid to call
|
||||
// addRect(), setUserBatchID(), or this method again.
|
||||
//
|
||||
// 'backingTexture', if provided, is a renderable texture with which to instantiate our proxy.
|
||||
// If null then we will create a texture using the resource provider. The purpose of this param
|
||||
// is to provide a guaranteed way to recycle a stashed atlas texture from a previous flush.
|
||||
std::unique_ptr<GrRenderTargetContext> instantiate(
|
||||
std::unique_ptr<GrSurfaceDrawContext> instantiate(
|
||||
GrOnFlushResourceProvider*, sk_sp<GrTexture> backingTexture = nullptr);
|
||||
|
||||
private:
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "src/gpu/GrFixedClip.h"
|
||||
|
||||
#include "src/gpu/GrAppliedClip.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
|
||||
SkIRect GrFixedClip::getConservativeBounds() const {
|
||||
return fScissorState.rect();
|
||||
|
@ -13,11 +13,11 @@
|
||||
#include "src/gpu/GrDrawingManager.h"
|
||||
#include "src/gpu/GrProxyProvider.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrSurfaceProxy.h"
|
||||
#include "src/gpu/GrTextureResolveRenderTask.h"
|
||||
|
||||
std::unique_ptr<GrRenderTargetContext> GrOnFlushResourceProvider::makeRenderTargetContext(
|
||||
std::unique_ptr<GrSurfaceDrawContext> GrOnFlushResourceProvider::makeRenderTargetContext(
|
||||
sk_sp<GrSurfaceProxy> proxy, GrSurfaceOrigin origin, GrColorType colorType,
|
||||
sk_sp<SkColorSpace> colorSpace, const SkSurfaceProps* props) {
|
||||
// Since this is at flush time and these won't be allocated for us by the GrResourceAllocator
|
||||
@ -32,7 +32,7 @@ std::unique_ptr<GrRenderTargetContext> GrOnFlushResourceProvider::makeRenderTarg
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto renderTargetContext = GrRenderTargetContext::Make(
|
||||
auto renderTargetContext = GrSurfaceDrawContext::Make(
|
||||
context, colorType, std::move(colorSpace), std::move(proxy),
|
||||
origin, props, true);
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
class GrDrawingManager;
|
||||
class GrOnFlushResourceProvider;
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
class GrSurfaceProxy;
|
||||
class SkColorSpace;
|
||||
class SkSurfaceProps;
|
||||
@ -62,7 +62,7 @@ public:
|
||||
|
||||
explicit GrOnFlushResourceProvider(GrDrawingManager* drawingMgr) : fDrawingMgr(drawingMgr) {}
|
||||
|
||||
std::unique_ptr<GrRenderTargetContext> makeRenderTargetContext(sk_sp<GrSurfaceProxy>,
|
||||
std::unique_ptr<GrSurfaceDrawContext> makeRenderTargetContext(sk_sp<GrSurfaceProxy>,
|
||||
GrSurfaceOrigin, GrColorType,
|
||||
sk_sp<SkColorSpace>,
|
||||
const SkSurfaceProps*);
|
||||
|
@ -19,8 +19,8 @@
|
||||
#include "src/gpu/GrOpsRenderPass.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTarget.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrResourceAllocator.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrTexture.h"
|
||||
#include "src/gpu/geometry/GrRect.h"
|
||||
#include "src/gpu/ops/GrClearOp.h"
|
||||
|
@ -240,7 +240,7 @@ private:
|
||||
// clearing can be done natively, in which case the op list's load ops are sufficient. In other
|
||||
// cases, draw ops must be used, which makes the RTC the best place for those decisions. This,
|
||||
// however, requires that the RTC be able to coordinate with the op list to achieve similar ends
|
||||
friend class GrRenderTargetContext;
|
||||
friend class GrSurfaceDrawContext;
|
||||
|
||||
// This is a backpointer to the Arenas that holds the memory for this GrOpsTask's ops. In the
|
||||
// DDL case, the Arenas must have been detached from the original recording context and moved
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "src/gpu/GrPaint.h"
|
||||
#include "src/gpu/GrPathRenderer.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrUserStencilSettings.h"
|
||||
#include "src/gpu/geometry/GrStyledShape.h"
|
||||
|
||||
|
@ -17,7 +17,7 @@ class GrClip;
|
||||
class GrHardClip;
|
||||
class GrPaint;
|
||||
class GrRecordingContext;
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
class GrRenderTargetProxy;
|
||||
class GrStyledShape;
|
||||
class GrStyle;
|
||||
@ -114,7 +114,7 @@ public:
|
||||
GrRecordingContext* fContext;
|
||||
GrPaint&& fPaint;
|
||||
const GrUserStencilSettings* fUserStencilSettings;
|
||||
GrRenderTargetContext* fRenderTargetContext;
|
||||
GrSurfaceDrawContext* fRenderTargetContext;
|
||||
const GrClip* fClip;
|
||||
const SkIRect* fClipConservativeBounds;
|
||||
const SkMatrix* fViewMatrix;
|
||||
@ -145,7 +145,7 @@ public:
|
||||
SkDEBUGCODE(StencilPathArgs() { memset(this, 0, sizeof(*this)); }) // For validation.
|
||||
|
||||
GrRecordingContext* fContext;
|
||||
GrRenderTargetContext* fRenderTargetContext;
|
||||
GrSurfaceDrawContext* fRenderTargetContext;
|
||||
const GrHardClip* fClip;
|
||||
const SkIRect* fClipConservativeBounds;
|
||||
const SkMatrix* fViewMatrix;
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "src/gpu/GrAppliedClip.h"
|
||||
#include "src/gpu/GrCaps.h"
|
||||
#include "src/gpu/GrGpu.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrXferProcessor.h"
|
||||
|
||||
#include "src/gpu/ops/GrOp.h"
|
||||
|
@ -26,7 +26,7 @@
|
||||
class GrAppliedClip;
|
||||
class GrAppliedHardClip;
|
||||
class GrOp;
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
|
||||
/**
|
||||
* This immutable object contains information needed to set build a shader program and set API
|
||||
|
@ -22,7 +22,7 @@
|
||||
class SkMatrix;
|
||||
class GrCaps;
|
||||
class GrProxyProvider;
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
class GrProcessorTestData;
|
||||
class GrTexture;
|
||||
class GrXPFactory;
|
||||
|
@ -23,8 +23,8 @@
|
||||
#include "src/gpu/GrDirectContextPriv.h"
|
||||
#include "src/gpu/GrImageContextPriv.h"
|
||||
#include "src/gpu/GrRenderTarget.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrResourceProvider.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrSurfaceProxy.h"
|
||||
#include "src/gpu/GrSurfaceProxyPriv.h"
|
||||
#include "src/gpu/GrTexture.h"
|
||||
@ -246,7 +246,7 @@ GrSurfaceProxyView GrProxyProvider::findCachedProxyWithColorTypeFallback(const G
|
||||
if (proxy->asRenderTargetProxy()) {
|
||||
GrBackendFormat expectedFormat;
|
||||
std::tie(ct, expectedFormat) =
|
||||
GrRenderTargetContext::GetFallbackColorTypeAndFormat(fImageContext, ct, sampleCnt);
|
||||
GrSurfaceDrawContext::GetFallbackColorTypeAndFormat(fImageContext, ct, sampleCnt);
|
||||
SkASSERT(expectedFormat == proxy->backendFormat());
|
||||
}
|
||||
GrSwizzle swizzle = fImageContext->priv().caps()->getReadSwizzle(proxy->backendFormat(), ct);
|
||||
|
@ -62,7 +62,7 @@ public:
|
||||
/**
|
||||
* A helper that uses findOrCreateProxyByUniqueKey() to find a proxy and if found creates a view
|
||||
* a view for the found proxy using the passed in origin and color type. It is assumed that if
|
||||
* the proxy is renderable then it was created by GrRenderTargetContext::MakeWithFallback and
|
||||
* the proxy is renderable then it was created by GrSurfaceDrawContext::MakeWithFallback and
|
||||
* the fallback color type will be used to create the view.
|
||||
*/
|
||||
GrSurfaceProxyView findCachedProxyWithColorTypeFallback(const GrUniqueKey&,
|
||||
|
@ -17,8 +17,8 @@
|
||||
#include "src/gpu/GrProgramDesc.h"
|
||||
#include "src/gpu/GrProxyProvider.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSurfaceContext.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/SkGr.h"
|
||||
#include "src/gpu/effects/GrSkSLFP.h"
|
||||
#include "src/gpu/text/GrTextBlobCache.h"
|
||||
|
@ -14,11 +14,11 @@
|
||||
#include "src/gpu/GrPathRenderer.h"
|
||||
#include "src/gpu/GrRecordingContextPriv.h"
|
||||
#include "src/gpu/GrReducedClip.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrStencilClip.h"
|
||||
#include "src/gpu/GrStencilMaskHelper.h"
|
||||
#include "src/gpu/GrStencilSettings.h"
|
||||
#include "src/gpu/GrStyle.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
#include "src/gpu/GrUserStencilSettings.h"
|
||||
#include "src/gpu/ccpr/GrCoverageCountingPathRenderer.h"
|
||||
#include "src/gpu/effects/GrConvexPolyEffect.h"
|
||||
@ -724,7 +724,7 @@ void GrReducedClip::makeEmpty() {
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Create a 8-bit clip mask in alpha
|
||||
|
||||
static bool stencil_element(GrRenderTargetContext* rtc,
|
||||
static bool stencil_element(GrSurfaceDrawContext* rtc,
|
||||
const GrFixedClip& clip,
|
||||
const GrUserStencilSettings* ss,
|
||||
const SkMatrix& viewMatrix,
|
||||
@ -757,7 +757,7 @@ static bool stencil_element(GrRenderTargetContext* rtc,
|
||||
return false;
|
||||
}
|
||||
|
||||
static void draw_element(GrRenderTargetContext* rtc,
|
||||
static void draw_element(GrSurfaceDrawContext* rtc,
|
||||
const GrClip& clip, // TODO: can this just always be WideOpen?
|
||||
GrPaint&& paint,
|
||||
GrAA aa,
|
||||
@ -784,7 +784,7 @@ static void draw_element(GrRenderTargetContext* rtc,
|
||||
}
|
||||
}
|
||||
|
||||
bool GrReducedClip::drawAlphaClipMask(GrRenderTargetContext* rtc) const {
|
||||
bool GrReducedClip::drawAlphaClipMask(GrSurfaceDrawContext* rtc) const {
|
||||
// The texture may be larger than necessary, this rect represents the part of the texture
|
||||
// we populate with a rasterization of the clip.
|
||||
GrFixedClip clip(rtc->dimensions(), SkIRect::MakeWH(fScissor.width(), fScissor.height()));
|
||||
@ -865,7 +865,7 @@ bool GrReducedClip::drawAlphaClipMask(GrRenderTargetContext* rtc) const {
|
||||
// Create a 1-bit clip mask in the stencil buffer.
|
||||
|
||||
bool GrReducedClip::drawStencilClipMask(GrRecordingContext* context,
|
||||
GrRenderTargetContext* renderTargetContext) const {
|
||||
GrSurfaceDrawContext* renderTargetContext) const {
|
||||
GrStencilMaskHelper helper(context, renderTargetContext);
|
||||
if (!helper.init(fScissor, this->maskGenID(), fWindowRects, this->numAnalyticElements())) {
|
||||
// The stencil mask doesn't need updating
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
class GrCoverageCountingPathRenderer;
|
||||
class GrRecordingContext;
|
||||
class GrRenderTargetContext;
|
||||
class GrSurfaceDrawContext;
|
||||
|
||||
/**
|
||||
* This class takes a clip stack and produces a reduced set of elements that are equivalent to
|
||||
@ -90,8 +90,8 @@ public:
|
||||
*/
|
||||
bool maskRequiresAA() const { SkASSERT(!fMaskElements.isEmpty()); return fMaskRequiresAA; }
|
||||
|
||||
bool drawAlphaClipMask(GrRenderTargetContext*) const;
|
||||
bool drawStencilClipMask(GrRecordingContext*, GrRenderTargetContext*) const;
|
||||
bool drawAlphaClipMask(GrSurfaceDrawContext*) const;
|
||||
bool drawStencilClipMask(GrRecordingContext*, GrSurfaceDrawContext*) const;
|
||||
|
||||
int numAnalyticElements() const;
|
||||
|
||||
|
@ -12,9 +12,9 @@
|
||||
#include "src/gpu/GrAttachment.h"
|
||||
#include "src/gpu/GrBackendUtils.h"
|
||||
#include "src/gpu/GrGpu.h"
|
||||
#include "src/gpu/GrRenderTargetContext.h"
|
||||
#include "src/gpu/GrSamplePatternDictionary.h"
|
||||
#include "src/gpu/GrStencilSettings.h"
|
||||
#include "src/gpu/GrSurfaceDrawContext.h"
|
||||
|
||||
GrRenderTarget::GrRenderTarget(GrGpu* gpu,
|
||||
const SkISize& dimensions,
|
||||
|
@ -66,7 +66,7 @@ static bool get_unclipped_shape_dev_bounds(const GrStyledShape& shape, const SkM
|
||||
|
||||
// Gets the shape bounds, the clip bounds, and the intersection (if any). Returns false if there
|
||||
// is no intersection.
|
||||
bool GrSoftwarePathRenderer::GetShapeAndClipBounds(GrRenderTargetContext* renderTargetContext,
|
||||
bool GrSoftwarePathRenderer::GetShapeAndClipBounds(GrSurfaceDrawContext* renderTargetContext,
|
||||
const GrClip* clip,
|
||||
const GrStyledShape& shape,
|
||||
const SkMatrix& matrix,
|
||||
@ -92,7 +92,7 @@ bool GrSoftwarePathRenderer::GetShapeAndClipBounds(GrRenderTargetContext* render
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void GrSoftwarePathRenderer::DrawNonAARect(GrRenderTargetContext* renderTargetContext,
|
||||
void GrSoftwarePathRenderer::DrawNonAARect(GrSurfaceDrawContext* renderTargetContext,
|
||||
GrPaint&& paint,
|
||||
const GrUserStencilSettings& userStencilSettings,
|
||||
const GrClip* clip,
|
||||
@ -103,7 +103,7 @@ void GrSoftwarePathRenderer::DrawNonAARect(GrRenderTargetContext* renderTargetCo
|
||||
viewMatrix, rect, &localMatrix);
|
||||
}
|
||||
|
||||
void GrSoftwarePathRenderer::DrawAroundInvPath(GrRenderTargetContext* renderTargetContext,
|
||||
void GrSoftwarePathRenderer::DrawAroundInvPath(GrSurfaceDrawContext* renderTargetContext,
|
||||
GrPaint&& paint,
|
||||
const GrUserStencilSettings& userStencilSettings,
|
||||
const GrClip* clip,
|
||||
@ -144,7 +144,7 @@ void GrSoftwarePathRenderer::DrawAroundInvPath(GrRenderTargetContext* renderTarg
|
||||
|
||||
void GrSoftwarePathRenderer::DrawToTargetWithShapeMask(
|
||||
GrSurfaceProxyView view,
|
||||
GrRenderTargetContext* renderTargetContext,
|
||||
GrSurfaceDrawContext* renderTargetContext,
|
||||
GrPaint&& paint,
|
||||
const GrUserStencilSettings& userStencilSettings,
|
||||
const GrClip* clip,
|
||||
|
@ -26,7 +26,7 @@ public:
|
||||
, fAllowCaching(allowCaching) {
|
||||
}
|
||||
|
||||
static bool GetShapeAndClipBounds(GrRenderTargetContext*,
|
||||
static bool GetShapeAndClipBounds(GrSurfaceDrawContext*,
|
||||
const GrClip* clip,
|
||||
const GrStyledShape& shape,
|
||||
const SkMatrix& matrix,
|
||||
@ -35,14 +35,14 @@ public:
|
||||
SkIRect* devClipBounds);
|
||||
|
||||
private:
|
||||
static void DrawNonAARect(GrRenderTargetContext* renderTargetContext,
|
||||
static void DrawNonAARect(GrSurfaceDrawContext* renderTargetContext,
|
||||
GrPaint&& paint,
|
||||
const GrUserStencilSettings& userStencilSettings,
|
||||
const GrClip* clip,
|
||||
const SkMatrix& viewMatrix,
|
||||
const SkRect& rect,
|
||||
const SkMatrix& localMatrix);
|
||||
static void DrawAroundInvPath(GrRenderTargetContext* renderTargetContext,
|
||||
static void DrawAroundInvPath(GrSurfaceDrawContext* renderTargetContext,
|
||||
GrPaint&& paint,
|
||||
const GrUserStencilSettings& userStencilSettings,
|
||||
const GrClip* clip,
|
||||
@ -54,7 +54,7 @@ private:
|
||||
// space. The 'viewMatrix' will be used to ensure the correct local coords are provided to
|
||||
// any fragment processors in the paint.
|
||||
static void DrawToTargetWithShapeMask(GrSurfaceProxyView,
|
||||
GrRenderTargetContext* renderTargetContext,
|
||||
GrSurfaceDrawContext* renderTargetContext,
|
||||
GrPaint&& paint,
|
||||
const GrUserStencilSettings& userStencilSettings,
|
||||
const GrClip* clip,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user