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

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

Issue 1565313003: Revert of Add guards to GrTextureProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@gpudeviceguards
Patch Set: Created 4 years, 11 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/GrResourceProvider.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 /* 2 /*
3 * Copyright 2015 Google Inc. 3 * Copyright 2015 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "GrBatchTest.h" 9 #include "GrBatchTest.h"
10 #include "GrColor.h" 10 #include "GrColor.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // when the drawContext attempts to use it (via getDrawTarget). 50 // when the drawContext attempts to use it (via getDrawTarget).
51 GrDrawContext::GrDrawContext(GrDrawingManager* drawingMgr, 51 GrDrawContext::GrDrawContext(GrDrawingManager* drawingMgr,
52 GrRenderTarget* rt, 52 GrRenderTarget* rt,
53 const SkSurfaceProps* surfaceProps, 53 const SkSurfaceProps* surfaceProps,
54 GrSingleOwner* singleOwner) 54 GrSingleOwner* singleOwner)
55 : fDrawingManager(drawingMgr) 55 : fDrawingManager(drawingMgr)
56 , fRenderTarget(rt) 56 , fRenderTarget(rt)
57 , fDrawTarget(SkSafeRef(rt->getLastDrawTarget())) 57 , fDrawTarget(SkSafeRef(rt->getLastDrawTarget()))
58 , fTextContext(nullptr) 58 , fTextContext(nullptr)
59 , fSurfaceProps(SkSurfacePropsCopyOrDefault(surfaceProps)) 59 , fSurfaceProps(SkSurfacePropsCopyOrDefault(surfaceProps))
60 #ifdef SK_DEBUG 60 , fSingleOwner(singleOwner) {
61 , fSingleOwner(singleOwner)
62 #endif
63 {
64 SkDEBUGCODE(this->validate();) 61 SkDEBUGCODE(this->validate();)
65 } 62 }
66 63
67 #ifdef SK_DEBUG 64 #ifdef SK_DEBUG
68 void GrDrawContext::validate() const { 65 void GrDrawContext::validate() const {
69 SkASSERT(fRenderTarget); 66 SkASSERT(fRenderTarget);
70 ASSERT_OWNED_RESOURCE(fRenderTarget); 67 ASSERT_OWNED_RESOURCE(fRenderTarget);
71 68
72 if (fDrawTarget && !fDrawTarget->isClosed()) { 69 if (fDrawTarget && !fDrawTarget->isClosed()) {
73 SkASSERT(fRenderTarget->getLastDrawTarget() == fDrawTarget); 70 SkASSERT(fRenderTarget->getLastDrawTarget() == fDrawTarget);
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 pr->drawPath(args); 825 pr->drawPath(args);
829 } 826 }
830 827
831 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b atch) { 828 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b atch) {
832 ASSERT_SINGLE_OWNER 829 ASSERT_SINGLE_OWNER
833 RETURN_IF_ABANDONED 830 RETURN_IF_ABANDONED
834 SkDEBUGCODE(this->validate();) 831 SkDEBUGCODE(this->validate();)
835 832
836 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch); 833 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch);
837 } 834 }
OLDNEW
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrResourceProvider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698