aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-01-13 14:58:32 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-13 20:40:11 +0000
commitd9b6abb1a16493d85d4372bbf57b254023816feb (patch)
treeecb9fbd959d0b986f32dab7bb4d095cdef5b8332 /src/gpu
parent69f98c738c48baf087b09e30f8d2c67471fc3103 (diff)
Remove (unused) YUV API from SkPixelRef
YUV conversion happens via SkImage now. BUG=skia: Change-Id: I6e1fa18effb72cbb00a173a346769b873e372c40 Reviewed-on: https://skia-review.googlesource.com/7034 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/SkGr.cpp48
1 files changed, 0 insertions, 48 deletions
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index f3b900814a..3cca52f2b0 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -16,7 +16,6 @@
#include "GrTexturePriv.h"
#include "GrTypes.h"
#include "GrXferProcessor.h"
-#include "GrYUVProvider.h"
#include "SkAutoMalloc.h"
#include "SkBlendModePriv.h"
@@ -31,13 +30,11 @@
#include "SkPixelRef.h"
#include "SkResourceCache.h"
#include "SkTemplates.h"
-#include "SkYUVPlanesCache.h"
#include "effects/GrBicubicEffect.h"
#include "effects/GrConstColorProcessor.h"
#include "effects/GrDitherEffect.h"
#include "effects/GrPorterDuffXferProcessor.h"
#include "effects/GrXfermodeFragmentProcessor.h"
-#include "effects/GrYUVEffect.h"
#ifndef SK_IGNORE_ETC1_SUPPORT
# include "ktx.h"
@@ -111,48 +108,7 @@ GrPixelConfig GrIsCompressedTextureDataSupported(GrContext* ctx, SkData* data,
//////////////////////////////////////////////////////////////////////////////
-/**
- * Once we have made SkImages handle all lazy/deferred/generated content, the YUV apis will
- * be gone from SkPixelRef, and we can remove this subclass entirely.
- */
-class PixelRef_GrYUVProvider : public GrYUVProvider {
- SkPixelRef* fPR;
-
-public:
- PixelRef_GrYUVProvider(SkPixelRef* pr) : fPR(pr) {}
-
- uint32_t onGetID() override { return fPR->getGenerationID(); }
- bool onQueryYUV8(SkYUVSizeInfo* sizeInfo, SkYUVColorSpace* colorSpace) const override {
- return fPR->queryYUV8(sizeInfo, colorSpace);
- }
- bool onGetYUV8Planes(const SkYUVSizeInfo& sizeInfo, void* planes[3]) override {
- return fPR->getYUV8Planes(sizeInfo, planes);
- }
-};
-
-static sk_sp<GrTexture> create_texture_from_yuv(GrContext* ctx, const SkBitmap& bm,
- const GrSurfaceDesc& desc) {
- // Subsets are not supported, the whole pixelRef is loaded when using YUV decoding
- SkPixelRef* pixelRef = bm.pixelRef();
- if ((nullptr == pixelRef) ||
- (pixelRef->info().width() != bm.info().width()) ||
- (pixelRef->info().height() != bm.info().height())) {
- return nullptr;
- }
-
- PixelRef_GrYUVProvider provider(pixelRef);
-
- return provider.refAsTexture(ctx, desc, !bm.isVolatile());
-}
-
GrTexture* GrUploadBitmapToTexture(GrContext* ctx, const SkBitmap& bitmap) {
- GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(bitmap.info(), *ctx->caps());
-
- sk_sp<GrTexture> texture(create_texture_from_yuv(ctx, bitmap, desc));
- if (texture) {
- return texture.release();
- }
-
SkAutoLockPixels alp(bitmap);
if (!bitmap.readyToDraw()) {
return nullptr;
@@ -244,10 +200,6 @@ GrTexture* GrGenerateMipMapsAndUploadToTexture(GrContext* ctx, const SkBitmap& b
: SkDestinationSurfaceColorMode::kLegacy;
GrSurfaceDesc desc = GrImageInfoToSurfaceDesc(bitmap.info(), *ctx->caps());
- sk_sp<GrTexture> texture(create_texture_from_yuv(ctx, bitmap, desc));
- if (texture) {
- return texture.release();
- }
// We don't support Gray8 directly in the GL backend, so fail-over to GrUploadBitmapToTexture.
// That will transform the Gray8 to 8888, then use the driver/GPU to build mipmaps. If we build