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

Unified Diff: dm/DMSrcSink.cpp

Issue 1676663002: Test CodecImageGenerator on GPU bots (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Check maxTextureSize and signal a nonfatal error Created 4 years, 10 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 | « no previous file | tools/dm_flags.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | tools/dm_flags.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698