OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "gl/GrGLPathRendering.h" | 8 #include "gl/GrGLPathRendering.h" |
9 #include "gl/GrGLUtil.h" | 9 #include "gl/GrGLUtil.h" |
10 #include "gl/GrGLGpu.h" | 10 #include "gl/GrGLGpu.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 fCaps.bindFragmentInputSupport = | 84 fCaps.bindFragmentInputSupport = |
85 nullptr != glInterface->fFunctions.fBindFragmentInputLocation; | 85 nullptr != glInterface->fFunctions.fBindFragmentInputLocation; |
86 } | 86 } |
87 | 87 |
88 GrGLPathRendering::~GrGLPathRendering() { | 88 GrGLPathRendering::~GrGLPathRendering() { |
89 if (fPreallocatedPathCount > 0) { | 89 if (fPreallocatedPathCount > 0) { |
90 this->deletePaths(fFirstPreallocatedPathID, fPreallocatedPathCount); | 90 this->deletePaths(fFirstPreallocatedPathID, fPreallocatedPathCount); |
91 } | 91 } |
92 } | 92 } |
93 | 93 |
94 void GrGLPathRendering::abandonGpuResources() { | 94 void GrGLPathRendering::disconnect(GrGpu::DisconnectType type) { |
| 95 if (GrGpu::DisconnectType::kCleanup == type) { |
| 96 this->deletePaths(fFirstPreallocatedPathID, fPreallocatedPathCount); |
| 97 }; |
95 fPreallocatedPathCount = 0; | 98 fPreallocatedPathCount = 0; |
96 } | 99 } |
97 | 100 |
98 void GrGLPathRendering::resetContext() { | 101 void GrGLPathRendering::resetContext() { |
99 fHWProjectionMatrixState.invalidate(); | 102 fHWProjectionMatrixState.invalidate(); |
100 // we don't use the model view matrix. | 103 // we don't use the model view matrix. |
101 GL_CALL(MatrixLoadIdentity(GR_GL_PATH_MODELVIEW)); | 104 GL_CALL(MatrixLoadIdentity(GR_GL_PATH_MODELVIEW)); |
102 | 105 |
103 fHWPathStencilSettings.invalidate(); | 106 fHWPathStencilSettings.invalidate(); |
104 } | 107 } |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 funcMask != fHWPathStencilSettings.funcMask(kFront_Face)) { | 333 funcMask != fHWPathStencilSettings.funcMask(kFront_Face)) { |
331 GL_CALL(PathStencilFunc(GrToGLStencilFunc(func), funcRef, funcMask))
; | 334 GL_CALL(PathStencilFunc(GrToGLStencilFunc(func), funcRef, funcMask))
; |
332 } | 335 } |
333 fHWPathStencilSettings = stencilSettings; | 336 fHWPathStencilSettings = stencilSettings; |
334 } | 337 } |
335 } | 338 } |
336 | 339 |
337 inline GrGLGpu* GrGLPathRendering::gpu() { | 340 inline GrGLGpu* GrGLPathRendering::gpu() { |
338 return static_cast<GrGLGpu*>(fGpu); | 341 return static_cast<GrGLGpu*>(fGpu); |
339 } | 342 } |
OLD | NEW |