Add debug option to clip each GrBatch to its device bounds
Review URL: https://codereview.chromium.org/1471083002
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 920e3c4..ad89672 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -72,11 +72,11 @@
if (!fGpu) {
return false;
}
- this->initCommon();
+ this->initCommon(options);
return true;
}
-void GrContext::initCommon() {
+void GrContext::initCommon(const GrContextOptions& options) {
fCaps = SkRef(fGpu->caps());
fResourceCache = new GrResourceCache(fCaps);
fResourceCache->setOverBudgetCallback(OverBudgetCB, this);
@@ -86,7 +86,9 @@
fDidTestPMConversions = false;
- fDrawingManager.reset(new GrDrawingManager(this));
+ GrDrawTarget::Options dtOptions;
+ dtOptions.fClipBatchToBounds = options.fClipBatchToBounds;
+ fDrawingManager.reset(new GrDrawingManager(this, dtOptions));
// GrBatchFontCache will eventually replace GrFontCache
fBatchFontCache = new GrBatchFontCache(this);