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

Unified Diff: src/gpu/gl/GrGLGpu.cpp

Issue 1370223002: Revert[4] of add ImageShader, sharing code with its Bitmap cousin (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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
Index: src/gpu/gl/GrGLGpu.cpp
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index cb12fefc3291f48388275702a71e48d555ddd408..5388387c3b0104a198ab58bae9b6c5b974fde7ce 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -2246,6 +2246,18 @@ static inline GrGLenum tile_to_gl_wrap(SkShader::TileMode tm) {
void GrGLGpu::bindTexture(int unitIdx, const GrTextureParams& params, GrGLTexture* texture) {
SkASSERT(texture);
+#ifdef SK_DEBUG
+ if (!this->caps()->npotTextureTileSupport()) {
+ const bool tileX = SkShader::kClamp_TileMode != params.getTileModeX();
+ const bool tileY = SkShader::kClamp_TileMode != params.getTileModeY();
+ if (tileX || tileY) {
+ const int w = texture->width();
+ const int h = texture->height();
+ SkASSERT(SkIsPow2(w) && SkIsPow2(h));
+ }
+ }
+#endif
+
// If we created a rt/tex and rendered to it without using a texture and now we're texturing
// from the rt it will still be the last bound texture, but it needs resolving. So keep this
// out of the "last != next" check.

Powered by Google App Engine
This is Rietveld 408576698