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

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

Issue 2339233003: Support Float32 output from SkColorSpaceXform (Closed)
Patch Set: Some fixes Created 4 years, 3 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 19 matching lines...) Expand all
30 30
31 #include "effects/GrRRectEffect.h" 31 #include "effects/GrRRectEffect.h"
32 32
33 #include "instanced/InstancedRendering.h" 33 #include "instanced/InstancedRendering.h"
34 34
35 #include "text/GrAtlasTextContext.h" 35 #include "text/GrAtlasTextContext.h"
36 #include "text/GrStencilAndCoverTextContext.h" 36 #include "text/GrStencilAndCoverTextContext.h"
37 37
38 #include "../private/GrAuditTrail.h" 38 #include "../private/GrAuditTrail.h"
39 39
40 #include "SkColorSpaceXform.h"
40 #include "SkGr.h" 41 #include "SkGr.h"
41 #include "SkLatticeIter.h" 42 #include "SkLatticeIter.h"
42 #include "SkMatrixPriv.h" 43 #include "SkMatrixPriv.h"
43 44
44 #define ASSERT_OWNED_RESOURCE(R) SkASSERT(!(R) || (R)->getContext() == fDrawingM anager->getContext()) 45 #define ASSERT_OWNED_RESOURCE(R) SkASSERT(!(R) || (R)->getContext() == fDrawingM anager->getContext())
45 #define ASSERT_SINGLE_OWNER \ 46 #define ASSERT_SINGLE_OWNER \
46 SkDEBUGCODE(GrSingleOwner::AutoEnforce debug_SingleOwner(fSingleOwner);) 47 SkDEBUGCODE(GrSingleOwner::AutoEnforce debug_SingleOwner(fSingleOwner);)
47 #define ASSERT_SINGLE_OWNER_PRIV \ 48 #define ASSERT_SINGLE_OWNER_PRIV \
48 SkDEBUGCODE(GrSingleOwner::AutoEnforce debug_SingleOwner(fDrawContext->fSing leOwner);) 49 SkDEBUGCODE(GrSingleOwner::AutoEnforce debug_SingleOwner(fDrawContext->fSing leOwner);)
49 #define RETURN_IF_ABANDONED if (fDrawingManager->wasAbandoned()) { return ; } 50 #define RETURN_IF_ABANDONED if (fDrawingManager->wasAbandoned()) { return ; }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 , fColorXformFromSRGB(nullptr) 90 , fColorXformFromSRGB(nullptr)
90 , fSurfaceProps(SkSurfacePropsCopyOrDefault(surfaceProps)) 91 , fSurfaceProps(SkSurfacePropsCopyOrDefault(surfaceProps))
91 , fAuditTrail(auditTrail) 92 , fAuditTrail(auditTrail)
92 #ifdef SK_DEBUG 93 #ifdef SK_DEBUG
93 , fSingleOwner(singleOwner) 94 , fSingleOwner(singleOwner)
94 #endif 95 #endif
95 { 96 {
96 if (fColorSpace) { 97 if (fColorSpace) {
97 // sRGB sources are very common (SkColor, etc...), so we cache that gamu t transformation 98 // sRGB sources are very common (SkColor, etc...), so we cache that gamu t transformation
98 auto srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); 99 auto srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
99 fColorXformFromSRGB = GrColorSpaceXform::Make(srgbColorSpace.get(), fCol orSpace.get()); 100 fColorXformFromSRGB = SkColorSpaceXform::New(srgbColorSpace, fColorSpace );
100 } 101 }
101 SkDEBUGCODE(this->validate();) 102 SkDEBUGCODE(this->validate();)
102 } 103 }
103 104
104 #ifdef SK_DEBUG 105 #ifdef SK_DEBUG
105 void GrDrawContext::validate() const { 106 void GrDrawContext::validate() const {
106 SkASSERT(fRenderTarget); 107 SkASSERT(fRenderTarget);
107 ASSERT_OWNED_RESOURCE(fRenderTarget); 108 ASSERT_OWNED_RESOURCE(fRenderTarget);
108 109
109 if (fDrawTarget && !fDrawTarget->isClosed()) { 110 if (fDrawTarget && !fDrawTarget->isClosed()) {
(...skipping 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after
1426 1427
1427 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr Clip& clip, 1428 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr Clip& clip,
1428 GrDrawBatch* batch) { 1429 GrDrawBatch* batch) {
1429 ASSERT_SINGLE_OWNER 1430 ASSERT_SINGLE_OWNER
1430 RETURN_IF_ABANDONED 1431 RETURN_IF_ABANDONED
1431 SkDEBUGCODE(this->validate();) 1432 SkDEBUGCODE(this->validate();)
1432 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); 1433 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch");
1433 1434
1434 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); 1435 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch);
1435 } 1436 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698