| 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 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 , fSampleCount(samples) | 862 , fSampleCount(samples) |
| 863 , fUseDIText(diText) | 863 , fUseDIText(diText) |
| 864 , fThreaded(threaded) {} | 864 , fThreaded(threaded) {} |
| 865 | 865 |
| 866 void PreAbandonGpuContextErrorHandler(SkError, void*) {} | 866 void PreAbandonGpuContextErrorHandler(SkError, void*) {} |
| 867 | 867 |
| 868 DEFINE_bool(imm, false, "Run gpu configs in immediate mode."); | 868 DEFINE_bool(imm, false, "Run gpu configs in immediate mode."); |
| 869 DEFINE_bool(batchClip, false, "Clip each GrBatch to its device bounds for testin
g."); | 869 DEFINE_bool(batchClip, false, "Clip each GrBatch to its device bounds for testin
g."); |
| 870 DEFINE_bool(batchBounds, false, "Draw a wireframe bounds of each GrBatch."); | 870 DEFINE_bool(batchBounds, false, "Draw a wireframe bounds of each GrBatch."); |
| 871 DEFINE_int32(batchLookback, -1, "Maximum GrBatch lookback for combining, negativ
e means default."); | 871 DEFINE_int32(batchLookback, -1, "Maximum GrBatch lookback for combining, negativ
e means default."); |
| 872 DEFINE_int32(batchLookahead, -1, "Maximum GrBatch lookahead for combining, negat
ive means " |
| 873 "default."); |
| 872 | 874 |
| 873 Error GPUSink::draw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log) co
nst { | 875 Error GPUSink::draw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log) co
nst { |
| 874 GrContextOptions grOptions; | 876 GrContextOptions grOptions; |
| 875 grOptions.fImmediateMode = FLAGS_imm; | 877 grOptions.fImmediateMode = FLAGS_imm; |
| 876 grOptions.fClipBatchToBounds = FLAGS_batchClip; | 878 grOptions.fClipBatchToBounds = FLAGS_batchClip; |
| 877 grOptions.fDrawBatchBounds = FLAGS_batchBounds; | 879 grOptions.fDrawBatchBounds = FLAGS_batchBounds; |
| 878 grOptions.fMaxBatchLookback = FLAGS_batchLookback; | 880 grOptions.fMaxBatchLookback = FLAGS_batchLookback; |
| 881 grOptions.fMaxBatchLookahead = FLAGS_batchLookahead; |
| 879 | 882 |
| 880 src.modifyGrContextOptions(&grOptions); | 883 src.modifyGrContextOptions(&grOptions); |
| 881 | 884 |
| 882 GrContextFactory factory(grOptions); | 885 GrContextFactory factory(grOptions); |
| 883 const SkISize size = src.size(); | 886 const SkISize size = src.size(); |
| 884 const SkImageInfo info = | 887 const SkImageInfo info = |
| 885 SkImageInfo::Make(size.width(), size.height(), kN32_SkColorType, kPremul
_SkAlphaType); | 888 SkImageInfo::Make(size.width(), size.height(), kN32_SkColorType, kPremul
_SkAlphaType); |
| 886 #if SK_SUPPORT_GPU | 889 #if SK_SUPPORT_GPU |
| 887 const int maxDimension = factory.getContextInfo(fContextType, fContextOption
s). | 890 const int maxDimension = factory.getContextInfo(fContextType, fContextOption
s). |
| 888 fGrContext->caps()->maxTextureSize(); | 891 fGrContext->caps()->maxTextureSize(); |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1422 skr.visit<void>(i, drawsAsSingletonPictures); | 1425 skr.visit<void>(i, drawsAsSingletonPictures); |
| 1423 } | 1426 } |
| 1424 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); | 1427 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); |
| 1425 | 1428 |
| 1426 canvas->drawPicture(macroPic); | 1429 canvas->drawPicture(macroPic); |
| 1427 return check_against_reference(bitmap, src, fSink); | 1430 return check_against_reference(bitmap, src, fSink); |
| 1428 }); | 1431 }); |
| 1429 } | 1432 } |
| 1430 | 1433 |
| 1431 } // namespace DM | 1434 } // namespace DM |
| OLD | NEW |