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

Unified Diff: src/gpu/GrContext.cpp

Issue 880983008: More cleanup around GrContext, textures, and SkGr.cpp (Closed) Base URL: https://skia.googlesource.com/skia.git@npot_out
Patch Set: rebase Created 5 years, 11 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 | « include/gpu/GrContext.h ('k') | src/gpu/GrTexture.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index bcd84dd63c87aad29b00153dda694ea033f41026..5b157d2a8e83880f13cf55beff320558b46a4b2f 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -223,6 +223,14 @@ GrTextContext* GrContext::createTextContext(GrRenderTarget* renderTarget,
////////////////////////////////////////////////////////////////////////////////
+bool GrContext::isConfigTexturable(GrPixelConfig config) const {
+ return fGpu->caps()->isConfigTexturable(config);
+}
+
+bool GrContext::npotTextureTileSupport() const {
+ return fGpu->caps()->npotTextureTileSupport();
+}
+
GrTexture* GrContext::createTexture(const GrSurfaceDesc& desc, const void* srcData,
size_t rowBytes) {
return fGpu->createTexture(desc, true, srcData, rowBytes);
@@ -230,6 +238,11 @@ GrTexture* GrContext::createTexture(const GrSurfaceDesc& desc, const void* srcDa
GrTexture* GrContext::refScratchTexture(const GrSurfaceDesc& inDesc, ScratchTexMatch match,
bool calledDuringFlush) {
+ // Currently we don't recycle compressed textures as scratch.
+ if (GrPixelConfigIsCompressed(inDesc.fConfig)) {
+ return NULL;
+ }
+
// kNoStencil has no meaning if kRT isn't set.
SkASSERT((inDesc.fFlags & kRenderTarget_GrSurfaceFlag) ||
!(inDesc.fFlags & kNoStencil_GrSurfaceFlag));
@@ -338,14 +351,6 @@ GrRenderTarget* GrContext::wrapBackendRenderTarget(const GrBackendRenderTargetDe
return fGpu->wrapBackendRenderTarget(desc);
}
-///////////////////////////////////////////////////////////////////////////////
-
-bool GrContext::supportsIndex8PixelConfig() const {
- const GrDrawTargetCaps* caps = fGpu->caps();
- return caps->isConfigTexturable(kIndex_8_GrPixelConfig);
-}
-
-
////////////////////////////////////////////////////////////////////////////////
void GrContext::clear(const SkIRect* rect,
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/gpu/GrTexture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698