Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Unified Diff: src/gpu/SkGpuDevice.h

Issue 1034733002: Implement approx-match support in image filter saveLayer() offscreen. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix empty/out-of-range rects in GrTextureDomain Clamp mode Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/effects/SkMagnifierImageFilter.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.h
diff --git a/src/gpu/SkGpuDevice.h b/src/gpu/SkGpuDevice.h
index 2db40fc438b31f0d7f8cfa3b84772c6bd9a8791a..8c3414b1db025d8ab34f075180f9ffbfc397195e 100644
--- a/src/gpu/SkGpuDevice.h
+++ b/src/gpu/SkGpuDevice.h
@@ -41,6 +41,13 @@ public:
static SkGpuDevice* Create(GrRenderTarget* target, const SkSurfaceProps*, unsigned flags = 0);
/**
+ * Creates an SkGpuDevice from a GrRenderTarget whose texture width/height is
+ * different than its actual width/height (e.g., approx-match scratch texture).
+ */
+ static SkGpuDevice* Create(GrRenderTarget* target, int width, int height,
+ const SkSurfaceProps*, unsigned flags = 0);
+
+ /**
* New device that will create an offscreen renderTarget based on the ImageInfo and
* sampleCount. The Budgeted param controls whether the device's backing store counts against
* the resource cache budget. On failure, returns NULL.
@@ -67,7 +74,7 @@ public:
GrRenderTarget* accessRenderTarget() override;
SkImageInfo imageInfo() const override {
- return fRenderTarget ? fRenderTarget->surfacePriv().info() : SkImageInfo::MakeUnknown();
+ return fLegacyBitmap.info();
}
const SkSurfaceProps& surfaceProps() const { return fSurfaceProps; }
@@ -121,7 +128,7 @@ public:
const SkImageFilter::Context&,
SkBitmap*, SkIPoint*) override;
- bool filterTexture(GrContext*, GrTexture*, const SkImageFilter*,
+ bool filterTexture(GrContext*, GrTexture*, int width, int height, const SkImageFilter*,
const SkImageFilter::Context&,
SkBitmap* result, SkIPoint* offset);
@@ -147,7 +154,7 @@ private:
SkBitmap fLegacyBitmap;
bool fNeedClear;
- SkGpuDevice(GrRenderTarget*, const SkSurfaceProps*, unsigned flags);
+ SkGpuDevice(GrRenderTarget*, int width, int height, const SkSurfaceProps*, unsigned flags);
SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) override;
« no previous file with comments | « src/effects/SkMagnifierImageFilter.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698