OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "DMSrcSink.h" | 8 #include "DMSrcSink.h" |
9 #include "SkAndroidCodec.h" | 9 #include "SkAndroidCodec.h" |
10 #include "SkCodec.h" | 10 #include "SkCodec.h" |
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1079 grOptions.fMaxBatchLookahead = FLAGS_batchLookahead; | 1079 grOptions.fMaxBatchLookahead = FLAGS_batchLookahead; |
1080 | 1080 |
1081 src.modifyGrContextOptions(&grOptions); | 1081 src.modifyGrContextOptions(&grOptions); |
1082 | 1082 |
1083 GrContextFactory factory(grOptions); | 1083 GrContextFactory factory(grOptions); |
1084 const SkISize size = src.size(); | 1084 const SkISize size = src.size(); |
1085 const SkImageInfo info = | 1085 const SkImageInfo info = |
1086 SkImageInfo::Make(size.width(), size.height(), fColorType, | 1086 SkImageInfo::Make(size.width(), size.height(), fColorType, |
1087 kPremul_SkAlphaType, fProfileType); | 1087 kPremul_SkAlphaType, fProfileType); |
1088 #if SK_SUPPORT_GPU | 1088 #if SK_SUPPORT_GPU |
1089 const int maxDimension = factory.getContextInfo(fContextType, fContextOption
s). | 1089 GrContext* context = factory.getContextInfo(fContextType, fContextOptions).g
rContext(); |
1090 fGrContext->caps()->maxTextureSize(); | 1090 const int maxDimension = context->caps()->maxTextureSize(); |
1091 if (maxDimension < SkTMax(size.width(), size.height())) { | 1091 if (maxDimension < SkTMax(size.width(), size.height())) { |
1092 return Error::Nonfatal("Src too large to create a texture.\n"); | 1092 return Error::Nonfatal("Src too large to create a texture.\n"); |
1093 } | 1093 } |
1094 #endif | 1094 #endif |
1095 | 1095 |
1096 auto surface( | 1096 auto surface( |
1097 NewGpuSurface(&factory, fContextType, fContextOptions, info, fSample
Count, fUseDIText)); | 1097 NewGpuSurface(&factory, fContextType, fContextOptions, info, fSample
Count, fUseDIText)); |
1098 if (!surface) { | 1098 if (!surface) { |
1099 return "Could not create a surface."; | 1099 return "Could not create a surface."; |
1100 } | 1100 } |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1563 skr.visit(i, drawsAsSingletonPictures); | 1563 skr.visit(i, drawsAsSingletonPictures); |
1564 } | 1564 } |
1565 sk_sp<SkPicture> macroPic(macroRec.finishRecordingAsPicture()); | 1565 sk_sp<SkPicture> macroPic(macroRec.finishRecordingAsPicture()); |
1566 | 1566 |
1567 canvas->drawPicture(macroPic); | 1567 canvas->drawPicture(macroPic); |
1568 return check_against_reference(bitmap, src, fSink); | 1568 return check_against_reference(bitmap, src, fSink); |
1569 }); | 1569 }); |
1570 } | 1570 } |
1571 | 1571 |
1572 } // namespace DM | 1572 } // namespace DM |
OLD | NEW |