Index: dm/DMSrcSink.cpp |
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp |
index 9576f69d6708cc7214e87669248dafb1e8a45ca6..3af90f73f6f9b24a25dc5f14b14a03ed4deafd7a 100644 |
--- a/dm/DMSrcSink.cpp |
+++ b/dm/DMSrcSink.cpp |
@@ -855,6 +855,12 @@ Error GPUSink::draw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log) co |
const SkISize size = src.size(); |
const SkImageInfo info = |
SkImageInfo::Make(size.width(), size.height(), kN32_SkColorType, kPremul_SkAlphaType); |
+ const int maxDimension = factory.getContextInfo(fContextType, fContextOptions). |
+ fGrContext->caps()->maxTextureSize(); |
+ if (maxDimension < SkTMax(size.width(), size.height())) { |
scroggo
2016/02/08 16:00:09
I don't know enough about the GPU code to know if
msarett
2016/02/08 16:20:06
I had the same confusion before asking Brian :).
scroggo
2016/02/08 16:23:14
Agree that the variable name helps.
|
+ return Error::Nonfatal("Src too large to create a texture.\n"); |
+ } |
+ |
SkAutoTUnref<SkSurface> surface( |
NewGpuSurface(&factory, fContextType, fContextOptions, info, fSampleCount, fUseDIText)); |
if (!surface) { |