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

Side by Side Diff: dm/DMSrcSink.cpp

Issue 1492633007: Revert of Add option to draw wireframe batch bounds (Closed) Base URL: https://skia.googlesource.com/skia.git@master
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/DMGpuSupport.h ('k') | include/gpu/GrContextOptions.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 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 , fThreaded(threaded) {} 800 , fThreaded(threaded) {}
801 801
802 int GPUSink::enclave() const { 802 int GPUSink::enclave() const {
803 return fThreaded ? kAnyThread_Enclave : kGPU_Enclave; 803 return fThreaded ? kAnyThread_Enclave : kGPU_Enclave;
804 } 804 }
805 805
806 void PreAbandonGpuContextErrorHandler(SkError, void*) {} 806 void PreAbandonGpuContextErrorHandler(SkError, void*) {}
807 807
808 DEFINE_bool(imm, false, "Run gpu configs in immediate mode."); 808 DEFINE_bool(imm, false, "Run gpu configs in immediate mode.");
809 DEFINE_bool(batchClip, false, "Clip each GrBatch to its device bounds for testin g."); 809 DEFINE_bool(batchClip, false, "Clip each GrBatch to its device bounds for testin g.");
810 DEFINE_bool(batchBounds, false, "Draw a wireframe bounds of each GrBatch.");
811 810
812 Error GPUSink::draw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log) co nst { 811 Error GPUSink::draw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log) co nst {
813 GrContextOptions options; 812 GrContextOptions options;
814 if (FLAGS_imm) { 813 if (FLAGS_imm) {
815 options.fImmediateMode = true; 814 options.fImmediateMode = true;
816 } 815 }
817 if (FLAGS_batchClip) { 816 if (FLAGS_batchClip) {
818 options.fClipBatchToBounds = true; 817 options.fClipBatchToBounds = true;
819 } 818 }
820 if (FLAGS_batchBounds) {
821 options.fDrawBatchBounds = true;
822 }
823 src.modifyGrContextOptions(&options); 819 src.modifyGrContextOptions(&options);
824 820
825 GrContextFactory factory(options); 821 GrContextFactory factory(options);
826 const SkISize size = src.size(); 822 const SkISize size = src.size();
827 const SkImageInfo info = 823 const SkImageInfo info =
828 SkImageInfo::Make(size.width(), size.height(), kN32_SkColorType, kPremul _SkAlphaType); 824 SkImageInfo::Make(size.width(), size.height(), kN32_SkColorType, kPremul _SkAlphaType);
829 SkAutoTUnref<SkSurface> surface( 825 SkAutoTUnref<SkSurface> surface(
830 NewGpuSurface(&factory, fContextType, fGpuAPI, info, fSampleCount, f UseDIText)); 826 NewGpuSurface(&factory, fContextType, fGpuAPI, info, fSampleCount, f UseDIText));
831 if (!surface) { 827 if (!surface) {
832 return "Could not create a surface."; 828 return "Could not create a surface.";
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
1264 skr.visit<void>(i, drawsAsSingletonPictures); 1260 skr.visit<void>(i, drawsAsSingletonPictures);
1265 } 1261 }
1266 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); 1262 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture());
1267 1263
1268 canvas->drawPicture(macroPic); 1264 canvas->drawPicture(macroPic);
1269 return ""; 1265 return "";
1270 }); 1266 });
1271 } 1267 }
1272 1268
1273 } // namespace DM 1269 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMGpuSupport.h ('k') | include/gpu/GrContextOptions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698