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

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

Issue 2164363002: Add SkColorSpace to GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove ':' from comment Created 4 years, 5 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
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrDrawingManager.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 "GrBatchTest.h" 8 #include "GrBatchTest.h"
9 #include "GrColor.h" 9 #include "GrColor.h"
10 #include "GrDrawContext.h" 10 #include "GrDrawContext.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 return fDrawingManager->wasAbandoned(); 62 return fDrawingManager->wasAbandoned();
63 } 63 }
64 64
65 // In MDB mode the reffing of the 'getLastDrawTarget' call's result allows in-pr ogress 65 // In MDB mode the reffing of the 'getLastDrawTarget' call's result allows in-pr ogress
66 // drawTargets to be picked up and added to by drawContexts lower in the call 66 // drawTargets to be picked up and added to by drawContexts lower in the call
67 // stack. When this occurs with a closed drawTarget, a new one will be allocated 67 // stack. When this occurs with a closed drawTarget, a new one will be allocated
68 // when the drawContext attempts to use it (via getDrawTarget). 68 // when the drawContext attempts to use it (via getDrawTarget).
69 GrDrawContext::GrDrawContext(GrContext* context, 69 GrDrawContext::GrDrawContext(GrContext* context,
70 GrDrawingManager* drawingMgr, 70 GrDrawingManager* drawingMgr,
71 sk_sp<GrRenderTarget> rt, 71 sk_sp<GrRenderTarget> rt,
72 sk_sp<SkColorSpace> colorSpace,
72 const SkSurfaceProps* surfaceProps, 73 const SkSurfaceProps* surfaceProps,
73 GrAuditTrail* auditTrail, 74 GrAuditTrail* auditTrail,
74 GrSingleOwner* singleOwner) 75 GrSingleOwner* singleOwner)
75 : fDrawingManager(drawingMgr) 76 : fDrawingManager(drawingMgr)
76 , fRenderTarget(std::move(rt)) 77 , fRenderTarget(std::move(rt))
77 , fDrawTarget(SkSafeRef(fRenderTarget->getLastDrawTarget())) 78 , fDrawTarget(SkSafeRef(fRenderTarget->getLastDrawTarget()))
78 , fContext(context) 79 , fContext(context)
79 , fInstancedPipelineInfo(fRenderTarget.get()) 80 , fInstancedPipelineInfo(fRenderTarget.get())
81 , fColorSpace(std::move(colorSpace))
80 , fSurfaceProps(SkSurfacePropsCopyOrDefault(surfaceProps)) 82 , fSurfaceProps(SkSurfacePropsCopyOrDefault(surfaceProps))
81 , fAuditTrail(auditTrail) 83 , fAuditTrail(auditTrail)
82 #ifdef SK_DEBUG 84 #ifdef SK_DEBUG
83 , fSingleOwner(singleOwner) 85 , fSingleOwner(singleOwner)
84 #endif 86 #endif
85 { 87 {
86 SkDEBUGCODE(this->validate();) 88 SkDEBUGCODE(this->validate();)
87 } 89 }
88 90
89 #ifdef SK_DEBUG 91 #ifdef SK_DEBUG
(...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 1244
1243 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr Clip& clip, 1245 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr Clip& clip,
1244 GrDrawBatch* batch) { 1246 GrDrawBatch* batch) {
1245 ASSERT_SINGLE_OWNER 1247 ASSERT_SINGLE_OWNER
1246 RETURN_IF_ABANDONED 1248 RETURN_IF_ABANDONED
1247 SkDEBUGCODE(this->validate();) 1249 SkDEBUGCODE(this->validate();)
1248 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); 1250 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch");
1249 1251
1250 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); 1252 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch);
1251 } 1253 }
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrDrawingManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698