OLD | NEW |
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 "GrAARectRenderer.h" | 9 #include "GrAARectRenderer.h" |
10 #include "GrBatch.h" | 10 #include "GrBatch.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 private: | 27 private: |
28 GrContext* fContext; | 28 GrContext* fContext; |
29 }; | 29 }; |
30 | 30 |
31 GrDrawContext::GrDrawContext(GrContext* context, GrDrawTarget* drawTarget) | 31 GrDrawContext::GrDrawContext(GrContext* context, GrDrawTarget* drawTarget) |
32 : fContext(context) | 32 : fContext(context) |
33 , fDrawTarget(SkRef(drawTarget)) { | 33 , fDrawTarget(SkRef(drawTarget)) { |
34 } | 34 } |
35 | 35 |
| 36 GrDrawContext::~GrDrawContext() { |
| 37 SkSafeUnref(fDrawTarget); |
| 38 } |
| 39 |
36 void GrDrawContext::copySurface(GrRenderTarget* dst, GrSurface* src, | 40 void GrDrawContext::copySurface(GrRenderTarget* dst, GrSurface* src, |
37 const SkIRect& srcRect, const SkIPoint& dstPoint
) { | 41 const SkIRect& srcRect, const SkIPoint& dstPoint
) { |
38 if (!this->prepareToDraw(dst)) { | 42 if (!this->prepareToDraw(dst)) { |
39 return; | 43 return; |
40 } | 44 } |
41 | 45 |
42 fDrawTarget->copySurface(dst, src, srcRect, dstPoint); | 46 fDrawTarget->copySurface(dst, src, srcRect, dstPoint); |
43 } | 47 } |
44 | 48 |
45 void GrDrawContext::drawText(GrPipelineBuilder* pipelineBuilder, GrBatch* batch)
{ | 49 void GrDrawContext::drawText(GrPipelineBuilder* pipelineBuilder, GrBatch* batch)
{ |
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1262 return DrawVerticesBatch::Create(geometry, type, viewMatrix, | 1266 return DrawVerticesBatch::Create(geometry, type, viewMatrix, |
1263 positions.begin(), vertexCount, | 1267 positions.begin(), vertexCount, |
1264 indices.begin(), hasIndices ? vertexCount :
0, | 1268 indices.begin(), hasIndices ? vertexCount :
0, |
1265 colors.begin(), | 1269 colors.begin(), |
1266 texCoords.begin(), | 1270 texCoords.begin(), |
1267 bounds); | 1271 bounds); |
1268 } | 1272 } |
1269 | 1273 |
1270 #endif | 1274 #endif |
1271 | 1275 |
OLD | NEW |