aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrBackendTextureImageGenerator.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-07-30 13:13:17 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-30 19:32:13 +0000
commit7226c232d73356a37ec8cfef0ed55147e68dd2fd (patch)
tree47559e4a5994b5cffc5382e9bb230f49b6c04cd7 /src/gpu/GrBackendTextureImageGenerator.cpp
parent3ebd354730ea9590bf233deccfc24982ffe48a98 (diff)
Make GrTextureProxy store a GrTextureType.
Removes flag indicating rectangle or external as its now redundant. Bug: skia: Change-Id: Ia475b557390e7a6b0f19f6e189cf8c27090e397c Reviewed-on: https://skia-review.googlesource.com/144346 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrBackendTextureImageGenerator.cpp')
-rw-r--r--src/gpu/GrBackendTextureImageGenerator.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gpu/GrBackendTextureImageGenerator.cpp b/src/gpu/GrBackendTextureImageGenerator.cpp
index 466a842f23..74722c66f4 100644
--- a/src/gpu/GrBackendTextureImageGenerator.cpp
+++ b/src/gpu/GrBackendTextureImageGenerator.cpp
@@ -6,7 +6,6 @@
*/
#include "GrBackendTextureImageGenerator.h"
-
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrGpu.h"
@@ -19,9 +18,9 @@
#include "GrTexture.h"
#include "GrTexturePriv.h"
#include "GrTextureProxyPriv.h"
-
#include "SkGr.h"
#include "SkMessageBus.h"
+#include "gl/GrGLTexture.h"
GrBackendTextureImageGenerator::RefHelper::~RefHelper() {
SkASSERT(nullptr == fBorrowedTexture);
@@ -134,6 +133,11 @@ sk_sp<GrTextureProxy> GrBackendTextureImageGenerator::onGenerateTexture(
GrBackendTexture backendTexture = fBackendTexture;
RefHelper* refHelper = fRefHelper;
+ GrTextureType textureType = GrTextureType::k2D;
+ GrGLTextureInfo glInfo;
+ if (backendTexture.getGLTextureInfo(&glInfo)) {
+ textureType = GrGLTexture::TextureTypeFromTarget(glInfo.fTarget);
+ }
sk_sp<GrTextureProxy> proxy = proxyProvider->createLazyProxy(
[refHelper, releaseProcHelper, semaphore,
backendTexture](GrResourceProvider* resourceProvider) {
@@ -171,9 +175,8 @@ sk_sp<GrTextureProxy> GrBackendTextureImageGenerator::onGenerateTexture(
}
return tex;
-
},
- desc, fSurfaceOrigin, mipMapped, SkBackingFit::kExact, SkBudgeted::kNo);
+ desc, fSurfaceOrigin, mipMapped, textureType, SkBackingFit::kExact, SkBudgeted::kNo);
if (!proxy) {
return nullptr;