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

Side by Side Diff: src/gpu/GrDrawContext.cpp

Issue 1845283003: Gamma-correctness pushed into Skia, top-down. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove helper function for old pixel-config method of enabling decode Created 4 years, 8 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
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 "GrBatchTest.h" 8 #include "GrBatchTest.h"
9 #include "GrColor.h" 9 #include "GrColor.h"
10 #include "GrDrawContext.h" 10 #include "GrDrawContext.h"
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 const SkMatrix& viewMatrix, 379 const SkMatrix& viewMatrix,
380 const SkRect& rect) { 380 const SkRect& rect) {
381 ASSERT_SINGLE_OWNER_PRIV 381 ASSERT_SINGLE_OWNER_PRIV
382 RETURN_FALSE_IF_ABANDONED_PRIV 382 RETURN_FALSE_IF_ABANDONED_PRIV
383 SkDEBUGCODE(fDrawContext->validate();) 383 SkDEBUGCODE(fDrawContext->validate();)
384 GR_AUDIT_TRAIL_AUTO_FRAME(fDrawContext->fAuditTrail, "GrDrawContext::stencil Rect"); 384 GR_AUDIT_TRAIL_AUTO_FRAME(fDrawContext->fAuditTrail, "GrDrawContext::stencil Rect");
385 385
386 AutoCheckFlush acf(fDrawContext->fDrawingManager); 386 AutoCheckFlush acf(fDrawContext->fDrawingManager);
387 387
388 GrPaint paint; 388 GrPaint paint;
389 // SRGBTODO: AllowSRGBInputs?
bsalomon 2016/04/05 13:24:01 Shouldn't matter. This is used to draw clip masks
Brian Osman 2016/04/05 15:36:41 Acknowledged.
389 paint.setAntiAlias(doAA); 390 paint.setAntiAlias(doAA);
390 paint.setCoverageSetOpXPFactory(op, invert); 391 paint.setCoverageSetOpXPFactory(op, invert);
391 392
392 SkAutoTUnref<GrDrawBatch> batch(fDrawContext->getFillRectBatch(paint, viewMa trix, rect)); 393 SkAutoTUnref<GrDrawBatch> batch(fDrawContext->getFillRectBatch(paint, viewMa trix, rect));
393 if (batch) { 394 if (batch) {
394 GrPipelineBuilder pipelineBuilder(paint, fDrawContext->fRenderTarget, Gr Clip::WideOpen()); 395 GrPipelineBuilder pipelineBuilder(paint, fDrawContext->fRenderTarget, Gr Clip::WideOpen());
395 pipelineBuilder.setStencil(ss); 396 pipelineBuilder.setStencil(ss);
396 397
397 fDrawContext->getDrawTarget()->drawBatch(pipelineBuilder, batch, scissor Rect); 398 fDrawContext->getDrawTarget()->drawBatch(pipelineBuilder, batch, scissor Rect);
398 return true; 399 return true;
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 canDrawArgs.fIsStencilDisabled = isStencilDisabled; 895 canDrawArgs.fIsStencilDisabled = isStencilDisabled;
895 canDrawArgs.fIsStencilBufferMSAA = isStencilBufferMSAA; 896 canDrawArgs.fIsStencilBufferMSAA = isStencilBufferMSAA;
896 897
897 // Don't allow the SW renderer 898 // Don't allow the SW renderer
898 GrPathRenderer* pr = fDrawContext->fDrawingManager->getPathRenderer(canDrawA rgs, false, type); 899 GrPathRenderer* pr = fDrawContext->fDrawingManager->getPathRenderer(canDrawA rgs, false, type);
899 if (!pr) { 900 if (!pr) {
900 return false; 901 return false;
901 } 902 }
902 903
903 GrPaint paint; 904 GrPaint paint;
905 // SRGBTODO: AllowSRGBInputs?
bsalomon 2016/04/05 13:24:01 Also drawing clip masks here.
Brian Osman 2016/04/05 15:36:41 Acknowledged.
904 paint.setCoverageSetOpXPFactory(op, invert); 906 paint.setCoverageSetOpXPFactory(op, invert);
905 907
906 // TODO: it is unfortunate that we have to convert this to a GrClip to 908 // TODO: it is unfortunate that we have to convert this to a GrClip to
907 // call drawPath. 909 // call drawPath.
908 GrClip clip; 910 GrClip clip;
909 if (scissorRect) { 911 if (scissorRect) {
910 clip.setIRect(*scissorRect); 912 clip.setIRect(*scissorRect);
911 } 913 }
912 914
913 GrPipelineBuilder pipelineBuilder(paint, fDrawContext->fRenderTarget, clip); 915 GrPipelineBuilder pipelineBuilder(paint, fDrawContext->fRenderTarget, clip);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 } 1031 }
1030 1032
1031 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b atch) { 1033 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b atch) {
1032 ASSERT_SINGLE_OWNER 1034 ASSERT_SINGLE_OWNER
1033 RETURN_IF_ABANDONED 1035 RETURN_IF_ABANDONED
1034 SkDEBUGCODE(this->validate();) 1036 SkDEBUGCODE(this->validate();)
1035 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); 1037 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch");
1036 1038
1037 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch); 1039 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch);
1038 } 1040 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698