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

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

Issue 2307053002: Restructure flushing relationship between GrContext, GrDrawingManager, and GrResourceCache. (Closed)
Patch Set: Fix uninit vars 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
« 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 #define RETURN_FALSE_IF_ABANDONED_PRIV if (fDrawContext->fDrawingManager->wasAb andoned()) { return false; } 52 #define RETURN_FALSE_IF_ABANDONED_PRIV if (fDrawContext->fDrawingManager->wasAb andoned()) { return false; }
53 #define RETURN_NULL_IF_ABANDONED if (fDrawingManager->wasAbandoned()) { return nullptr; } 53 #define RETURN_NULL_IF_ABANDONED if (fDrawingManager->wasAbandoned()) { return nullptr; }
54 54
55 using gr_instanced::InstancedRendering; 55 using gr_instanced::InstancedRendering;
56 56
57 class AutoCheckFlush { 57 class AutoCheckFlush {
58 public: 58 public:
59 AutoCheckFlush(GrDrawingManager* drawingManager) : fDrawingManager(drawingMa nager) { 59 AutoCheckFlush(GrDrawingManager* drawingManager) : fDrawingManager(drawingMa nager) {
60 SkASSERT(fDrawingManager); 60 SkASSERT(fDrawingManager);
61 } 61 }
62 ~AutoCheckFlush() { fDrawingManager->getContext()->flushIfNecessary(); } 62 ~AutoCheckFlush() { fDrawingManager->flushIfNecessary(); }
63 63
64 private: 64 private:
65 GrDrawingManager* fDrawingManager; 65 GrDrawingManager* fDrawingManager;
66 }; 66 };
67 67
68 bool GrDrawContext::wasAbandoned() const { 68 bool GrDrawContext::wasAbandoned() const {
69 return fDrawingManager->wasAbandoned(); 69 return fDrawingManager->wasAbandoned();
70 } 70 }
71 71
72 // In MDB mode the reffing of the 'getLastDrawTarget' call's result allows in-pr ogress 72 // In MDB mode the reffing of the 'getLastDrawTarget' call's result allows in-pr ogress
(...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 1428
1429 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr Clip& clip, 1429 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr Clip& clip,
1430 GrDrawBatch* batch) { 1430 GrDrawBatch* batch) {
1431 ASSERT_SINGLE_OWNER 1431 ASSERT_SINGLE_OWNER
1432 RETURN_IF_ABANDONED 1432 RETURN_IF_ABANDONED
1433 SkDEBUGCODE(this->validate();) 1433 SkDEBUGCODE(this->validate();)
1434 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); 1434 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch");
1435 1435
1436 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); 1436 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch);
1437 } 1437 }
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