| Index: src/gpu/SkGpuDevice.h
|
| diff --git a/src/gpu/SkGpuDevice.h b/src/gpu/SkGpuDevice.h
|
| index e940159b22d068eb1deb3f2827cb8940c1b27110..474a030ef5bd787ab8152f0011bef8fffc7388cc 100644
|
| --- a/src/gpu/SkGpuDevice.h
|
| +++ b/src/gpu/SkGpuDevice.h
|
| @@ -36,17 +36,21 @@ public:
|
|
|
| /**
|
| * Creates an SkGpuDevice from a GrRenderTarget.
|
| + * TODO: rm this factory. It is used by SkSurface::MakeRenderTargetDirect,
|
| + * MakeFromBackendTexture, MakeFromBackendRenderTarget,
|
| + * and MakeFromBackendTextureAsRenderTarget. Only the first is worrisome.
|
| */
|
| static sk_sp<SkGpuDevice> Make(sk_sp<GrRenderTarget> target,
|
| const SkSurfaceProps*,
|
| InitContents);
|
|
|
| /**
|
| - * Creates an SkGpuDevice from a GrRenderTarget whose texture width/height is
|
| + * Creates an SkGpuDevice from a GrDrawContext whose backing width/height is
|
| * different than its actual width/height (e.g., approx-match scratch texture).
|
| */
|
| - static sk_sp<SkGpuDevice> Make(sk_sp<GrRenderTarget> target, int width, int height,
|
| - const SkSurfaceProps*, InitContents);
|
| + static sk_sp<SkBaseDevice> Make(sk_sp<GrDrawContext> drawContext,
|
| + int width, int height,
|
| + InitContents);
|
|
|
| /**
|
| * New device that will create an offscreen renderTarget based on the ImageInfo and
|
| @@ -70,7 +74,7 @@ public:
|
| // set all pixels to 0
|
| void clearAll();
|
|
|
| - void replaceRenderTarget(bool shouldRetainContent);
|
| + void replaceDrawContext(bool shouldRetainContent);
|
|
|
| GrRenderTarget* accessRenderTarget() override;
|
| GrDrawContext* accessDrawContext() override;
|
| @@ -148,7 +152,7 @@ protected:
|
| private:
|
| // We want these unreffed in DrawContext, RenderTarget, GrContext order.
|
| SkAutoTUnref<GrContext> fContext;
|
| - SkAutoTUnref<GrRenderTarget> fRenderTarget;
|
| + sk_sp<GrRenderTarget> fRenderTarget;
|
| sk_sp<GrDrawContext> fDrawContext;
|
|
|
| SkAutoTUnref<const SkClipStack> fClipStack;
|
| @@ -166,7 +170,7 @@ private:
|
| static bool CheckAlphaTypeAndGetFlags(const SkImageInfo* info, InitContents init,
|
| unsigned* flags);
|
|
|
| - SkGpuDevice(GrRenderTarget*, int width, int height, const SkSurfaceProps*, unsigned flags);
|
| + SkGpuDevice(sk_sp<GrDrawContext>, int width, int height, unsigned flags);
|
|
|
| SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) override;
|
|
|
| @@ -249,8 +253,11 @@ private:
|
|
|
| bool drawDashLine(const SkPoint pts[2], const SkPaint& paint);
|
|
|
| - static GrRenderTarget* CreateRenderTarget(GrContext*, SkBudgeted, const SkImageInfo&,
|
| - int sampleCount);
|
| + static sk_sp<GrDrawContext> CreateDrawContext(GrContext*,
|
| + SkBudgeted,
|
| + const SkImageInfo&,
|
| + int sampleCount,
|
| + const SkSurfaceProps*);
|
|
|
| void drawSpriteWithFilter(const SkDraw&, const SkBitmap&, int x, int y,
|
| const SkPaint&) override;
|
|
|