aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpu.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-03-21 12:13:37 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-21 17:04:18 +0000
commitabf7b763e2c1ba069942dedec914494817fd27a8 (patch)
treec956480efd2273f0371823d3ebf0a3af46c09cab /src/gpu/GrGpu.h
parente65a5cd3fc34ab90743056ace2ef0a3a01bf6346 (diff)
Add texture-specific flags for External & Rectangle textures
For DDLs, Ganesh needs to know about External & Rectangle textures prior to instantiation (or PromiseImage fulfillment). These new flags allow the client to provide this information when the lazyProxy is created. The new texture flags work analogously to the render target flags: GrSurface and GrSurfaceProxy get a new set of accessors for the new flags The new flags are set appropriately on a GrGLTexture when it is created For wrapped texture proxies the flags are just copied off of the GrSurface For lazy-proxies/promise-images the flags are computed up front and passed to the proxy The GrSurfaceProxy/GrSurface flags equivalence is verified in GrSurfaceProxy::assign Change-Id: Ia8e1998aa0a36ce4481bfd9e56be21f990e83148 Reviewed-on: https://skia-review.googlesource.com/114985 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrGpu.h')
-rw-r--r--src/gpu/GrGpu.h26
1 files changed, 3 insertions, 23 deletions
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index 95c5117799..78b6fd4654 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -506,26 +506,12 @@ public:
virtual void clearStencil(GrRenderTarget* target, int clearValue) = 0;
// Determines whether a texture will need to be rescaled in order to be used with the
- // GrSamplerState. This variation is called when the caller will create a new texture using the
- // resource provider from a non-texture src (cpu-backed image, ...).
- static bool IsACopyNeededForTextureParams(const GrCaps*, int width, int height,
+ // GrSamplerState.
+ static bool IsACopyNeededForTextureParams(const GrCaps*, GrTextureProxy* texProxy,
+ int width, int height,
const GrSamplerState&, GrTextureProducer::CopyParams*,
SkScalar scaleAdjust[2]);
- // Like the above but this variation should be called when the caller is not creating the
- // original texture but rather was handed the original texture. It adds additional checks
- // relevant to original textures that were created external to Skia via
- // GrResourceProvider::wrap methods.
- bool isACopyNeededForTextureParams(GrTextureProxy* proxy, const GrSamplerState& params,
- GrTextureProducer::CopyParams* copyParams,
- SkScalar scaleAdjust[2]) const {
- if (IsACopyNeededForTextureParams(this->caps(), proxy->width(), proxy->height(), params,
- copyParams, scaleAdjust)) {
- return true;
- }
- return this->onIsACopyNeededForTextureParams(proxy, params, copyParams, scaleAdjust);
- }
-
void handleDirtyContext() {
if (fResetBits) {
this->resetContext();
@@ -578,12 +564,6 @@ private:
virtual GrBuffer* onCreateBuffer(size_t size, GrBufferType intendedType, GrAccessPattern,
const void* data) = 0;
- virtual bool onIsACopyNeededForTextureParams(GrTextureProxy* proxy, const GrSamplerState&,
- GrTextureProducer::CopyParams*,
- SkScalar scaleAdjust[2]) const {
- return false;
- }
-
virtual bool onGetReadPixelsInfo(GrSurface*, GrSurfaceOrigin, int width, int height,
size_t rowBytes, GrColorType, DrawPreference*,
ReadPixelTempDrawInfo*) = 0;