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

Side by Side Diff: dm/DMSrcSink.cpp

Issue 1528473002: Revert of Add config options to run different GPU APIs to dm and nanobench (Closed) Base URL: https://skia.googlesource.com/skia.git@commandbuffer-as-api-03-context-factory-glcontext-type
Patch Set: Created 5 years 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/DMSrcSink.h ('k') | gyp/flags.gyp » ('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 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 SkAutoTDelete<SkCanvas> canvas(SkCreateNullCanvas()); 783 SkAutoTDelete<SkCanvas> canvas(SkCreateNullCanvas());
784 return src.draw(canvas); 784 return src.draw(canvas);
785 } 785 }
786 786
787 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~*/ 787 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~*/
788 788
789 DEFINE_bool(gpuStats, false, "Append GPU stats to the log for each GPU task?"); 789 DEFINE_bool(gpuStats, false, "Append GPU stats to the log for each GPU task?");
790 790
791 GPUSink::GPUSink(GrContextFactory::GLContextType ct, 791 GPUSink::GPUSink(GrContextFactory::GLContextType ct,
792 GrContextFactory::GLContextOptions options, 792 GrContextFactory::GLContextOptions options,
793 GrGLStandard gpuAPI,
793 int samples, 794 int samples,
794 bool diText, 795 bool diText,
795 bool threaded) 796 bool threaded)
796 : fContextType(ct) 797 : fContextType(ct)
797 , fContextOptions(options) 798 , fContextOptions(options)
799 , fGpuAPI(gpuAPI)
798 , fSampleCount(samples) 800 , fSampleCount(samples)
799 , fUseDIText(diText) 801 , fUseDIText(diText)
800 , fThreaded(threaded) {} 802 , fThreaded(threaded) {}
801 803
802 int GPUSink::enclave() const { 804 int GPUSink::enclave() const {
803 return fThreaded ? kAnyThread_Enclave : kGPU_Enclave; 805 return fThreaded ? kAnyThread_Enclave : kGPU_Enclave;
804 } 806 }
805 807
806 void PreAbandonGpuContextErrorHandler(SkError, void*) {} 808 void PreAbandonGpuContextErrorHandler(SkError, void*) {}
807 809
(...skipping 13 matching lines...) Expand all
821 if (FLAGS_batchBounds) { 823 if (FLAGS_batchBounds) {
822 grOptions.fDrawBatchBounds = true; 824 grOptions.fDrawBatchBounds = true;
823 } 825 }
824 src.modifyGrContextOptions(&grOptions); 826 src.modifyGrContextOptions(&grOptions);
825 827
826 GrContextFactory factory(grOptions); 828 GrContextFactory factory(grOptions);
827 const SkISize size = src.size(); 829 const SkISize size = src.size();
828 const SkImageInfo info = 830 const SkImageInfo info =
829 SkImageInfo::Make(size.width(), size.height(), kN32_SkColorType, kPremul _SkAlphaType); 831 SkImageInfo::Make(size.width(), size.height(), kN32_SkColorType, kPremul _SkAlphaType);
830 SkAutoTUnref<SkSurface> surface( 832 SkAutoTUnref<SkSurface> surface(
831 NewGpuSurface(&factory, fContextType, fContextOptions, info, fSample Count, fUseDIText)); 833 NewGpuSurface(&factory, fContextType, fContextOptions, fGpuAPI, info , fSampleCount,
834 fUseDIText));
832 if (!surface) { 835 if (!surface) {
833 return "Could not create a surface."; 836 return "Could not create a surface.";
834 } 837 }
835 if (FLAGS_preAbandonGpuContext) { 838 if (FLAGS_preAbandonGpuContext) {
836 SkSetErrorCallback(&PreAbandonGpuContextErrorHandler, nullptr); 839 SkSetErrorCallback(&PreAbandonGpuContextErrorHandler, nullptr);
837 factory.abandonContexts(); 840 factory.abandonContexts();
838 } 841 }
839 SkCanvas* canvas = surface->getCanvas(); 842 SkCanvas* canvas = surface->getCanvas();
840 Error err = src.draw(canvas); 843 Error err = src.draw(canvas);
841 if (!err.isEmpty()) { 844 if (!err.isEmpty()) {
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 skr.visit<void>(i, drawsAsSingletonPictures); 1268 skr.visit<void>(i, drawsAsSingletonPictures);
1266 } 1269 }
1267 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); 1270 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture());
1268 1271
1269 canvas->drawPicture(macroPic); 1272 canvas->drawPicture(macroPic);
1270 return ""; 1273 return "";
1271 }); 1274 });
1272 } 1275 }
1273 1276
1274 } // namespace DM 1277 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMSrcSink.h ('k') | gyp/flags.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698