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

Side by Side Diff: dm/DMSrcSink.cpp

Issue 1421853002: Add immediate mode option for gpu configs in dm (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add assert Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « dm/DMGpuSupport.h ('k') | include/gpu/GrContext.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "SamplePipeControllers.h" 9 #include "SamplePipeControllers.h"
10 #include "SkAndroidCodec.h" 10 #include "SkAndroidCodec.h"
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 , fSampleCount(samples) 910 , fSampleCount(samples)
911 , fUseDIText(diText) 911 , fUseDIText(diText)
912 , fThreaded(threaded) {} 912 , fThreaded(threaded) {}
913 913
914 int GPUSink::enclave() const { 914 int GPUSink::enclave() const {
915 return fThreaded ? kAnyThread_Enclave : kGPU_Enclave; 915 return fThreaded ? kAnyThread_Enclave : kGPU_Enclave;
916 } 916 }
917 917
918 void PreAbandonGpuContextErrorHandler(SkError, void*) {} 918 void PreAbandonGpuContextErrorHandler(SkError, void*) {}
919 919
920 DEFINE_bool(imm, false, "Run gpu configs in immediate mode.");
921
920 Error GPUSink::draw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log) co nst { 922 Error GPUSink::draw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log) co nst {
921 GrContextOptions options; 923 GrContextOptions options;
924 if (FLAGS_imm) {
925 options.fImmediateMode = true;
926 }
922 src.modifyGrContextOptions(&options); 927 src.modifyGrContextOptions(&options);
923 928
924 GrContextFactory factory(options); 929 GrContextFactory factory(options);
925 const SkISize size = src.size(); 930 const SkISize size = src.size();
926 const SkImageInfo info = 931 const SkImageInfo info =
927 SkImageInfo::Make(size.width(), size.height(), kN32_SkColorType, kPremul _SkAlphaType); 932 SkImageInfo::Make(size.width(), size.height(), kN32_SkColorType, kPremul _SkAlphaType);
928 SkAutoTUnref<SkSurface> surface( 933 SkAutoTUnref<SkSurface> surface(
929 NewGpuSurface(&factory, fContextType, fGpuAPI, info, fSampleCount, f UseDIText)); 934 NewGpuSurface(&factory, fContextType, fGpuAPI, info, fSampleCount, f UseDIText));
930 if (!surface) { 935 if (!surface) {
931 return "Could not create a surface."; 936 return "Could not create a surface.";
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
1363 skr.visit<void>(i, drawsAsSingletonPictures); 1368 skr.visit<void>(i, drawsAsSingletonPictures);
1364 } 1369 }
1365 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); 1370 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture());
1366 1371
1367 canvas->drawPicture(macroPic); 1372 canvas->drawPicture(macroPic);
1368 return ""; 1373 return "";
1369 }); 1374 });
1370 } 1375 }
1371 1376
1372 } // namespace DM 1377 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMGpuSupport.h ('k') | include/gpu/GrContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698