| OLD | NEW |
| 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 "GrAtlasTextContext.h" | 8 #include "GrAtlasTextContext.h" |
| 9 #include "GrDrawContext.h" | 9 #include "GrDrawContext.h" |
| 10 #include "GrDrawingManager.h" | 10 #include "GrDrawingManager.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 #ifndef ENABLE_MDB | 99 #ifndef ENABLE_MDB |
| 100 // When MDB is disabled we always just return the single drawTarget | 100 // When MDB is disabled we always just return the single drawTarget |
| 101 if (fDrawTargets.count()) { | 101 if (fDrawTargets.count()) { |
| 102 SkASSERT(fDrawTargets.count() == 1); | 102 SkASSERT(fDrawTargets.count() == 1); |
| 103 // DrawingManager gets the creation ref - this ref is for the caller | 103 // DrawingManager gets the creation ref - this ref is for the caller |
| 104 return SkRef(fDrawTargets[0]); | 104 return SkRef(fDrawTargets[0]); |
| 105 } | 105 } |
| 106 #endif | 106 #endif |
| 107 | 107 |
| 108 GrDrawTarget* dt = new GrDrawTarget(fContext->getGpu(), fContext->resourcePr
ovider()); | 108 GrDrawTarget* dt = new GrDrawTarget(fContext->getGpu(), fContext->resourcePr
ovider(), |
| 109 fOptions); |
| 109 | 110 |
| 110 *fDrawTargets.append() = dt; | 111 *fDrawTargets.append() = dt; |
| 111 | 112 |
| 112 // DrawingManager gets the creation ref - this ref is for the caller | 113 // DrawingManager gets the creation ref - this ref is for the caller |
| 113 return SkRef(dt); | 114 return SkRef(dt); |
| 114 } | 115 } |
| 115 | 116 |
| 116 GrDrawContext* GrDrawingManager::drawContext(GrRenderTarget* rt, | 117 GrDrawContext* GrDrawingManager::drawContext(GrRenderTarget* rt, |
| 117 const SkSurfaceProps* surfaceProps)
{ | 118 const SkSurfaceProps* surfaceProps)
{ |
| 118 if (this->abandoned()) { | 119 if (this->abandoned()) { |
| 119 return nullptr; | 120 return nullptr; |
| 120 } | 121 } |
| 121 | 122 |
| 122 return new GrDrawContext(this, rt, surfaceProps); | 123 return new GrDrawContext(this, rt, surfaceProps); |
| 123 } | 124 } |
| OLD | NEW |