diff options
Diffstat (limited to 'src/gpu/GrGpu.h')
-rw-r--r-- | src/gpu/GrGpu.h | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h index 7c92795c50..6adabf46d1 100644 --- a/src/gpu/GrGpu.h +++ b/src/gpu/GrGpu.h @@ -141,69 +141,6 @@ public: */ void resolveRenderTarget(GrRenderTarget*); - /** Describes why an intermediate draw must/should be performed before readPixels. */ - enum DrawPreference { - /** - * On input means that the caller would proceed without draw if the GrGpu doesn't request - * one. On output means that the GrGpu is not requesting a draw. - */ - kNoDraw_DrawPreference, - /** - * Means that the client would prefer a draw for performance of the readback but - * can satisfy a straight readPixels call on the inputs without an intermediate draw. - * getReadPixelsInfo will never set the draw preference to this value but may leave - * it set. - */ - kCallerPrefersDraw_DrawPreference, - /** - * On output means that GrGpu would prefer a draw for performance of the readback but - * can satisfy a straight readPixels call on the inputs without an intermediate draw. The - * caller of getReadPixelsInfo should never specify this on intput. - */ - kGpuPrefersDraw_DrawPreference, - /** - * On input means that the caller requires a draw to do a transformation and there is no - * CPU fallback. On output means that GrGpu can only satisfy the readPixels request if the - * intermediate draw is performed. - */ - kRequireDraw_DrawPreference - }; - - /** - * Info struct returned by getWritePixelsInfo about performing an intermediate draw in order - * to write pixels to a GrSurface for either performance or correctness reasons. - */ - struct WritePixelTempDrawInfo { - /** - * If the GrGpu is requesting that the caller upload to an intermediate surface and draw - * that to the dst then this is the descriptor for the intermediate surface. The caller - * should upload the pixels such that the upper left pixel of the upload rect is at 0,0 in - * the intermediate surface - */ - GrSurfaceDesc fTempSurfaceDesc; - /** - * Swizzle to apply during the draw. This is used to compensate for either feature or - * performance limitations in the underlying 3D API. - */ - GrSwizzle fSwizzle; - /** - * The color type that should be specified when uploading the *original* data to the temp - * surface before the draw. This may be different than the original src color type in - * order to compensate for swizzling that will occur when drawing. The original gamma - * encoding is always used. - */ - GrColorType fWriteColorType; - }; - - /** - * Used to negotiate whether and how an intermediate surface should be used to write pixels to - * a GrSurface. If this returns false then GrGpu could not deduce an intermediate draw - * that would allow a successful transfer of the src pixels to the dst. The passed width, - * height, and rowBytes, must be non-zero and already reflect clipping to the dst bounds. - */ - bool getWritePixelsInfo(GrSurface*, GrSurfaceOrigin, int width, int height, GrColorType, - GrSRGBConversion, DrawPreference*, WritePixelTempDrawInfo*); - /** * Reads a rectangle of pixels from a render target. No sRGB/linear conversions are performed. * @@ -472,16 +409,6 @@ public: } protected: - static void ElevateDrawPreference(GrGpu::DrawPreference* preference, - GrGpu::DrawPreference elevation) { - GR_STATIC_ASSERT(GrGpu::kCallerPrefersDraw_DrawPreference > GrGpu::kNoDraw_DrawPreference); - GR_STATIC_ASSERT(GrGpu::kGpuPrefersDraw_DrawPreference > - GrGpu::kCallerPrefersDraw_DrawPreference); - GR_STATIC_ASSERT(GrGpu::kRequireDraw_DrawPreference > - GrGpu::kGpuPrefersDraw_DrawPreference); - *preference = SkTMax(*preference, elevation); - } - // Handles cases where a surface will be updated without a call to flushRenderTarget. void didWriteToSurface(GrSurface* surface, GrSurfaceOrigin origin, const SkIRect* bounds, uint32_t mipLevels = 1) const; @@ -517,9 +444,6 @@ private: virtual GrBuffer* onCreateBuffer(size_t size, GrBufferType intendedType, GrAccessPattern, const void* data) = 0; - virtual bool onGetWritePixelsInfo(GrSurface*, GrSurfaceOrigin, int width, int height, - GrColorType, DrawPreference*, WritePixelTempDrawInfo*) = 0; - // overridden by backend-specific derived class to perform the surface read virtual bool onReadPixels(GrSurface*, GrSurfaceOrigin, int left, int top, int width, int height, GrColorType, void* buffer, size_t rowBytes) = 0; |