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

Side by Side Diff: src/gpu/gl/GrGLPathRendering.cpp

Issue 1852733002: Add GrContext::releaseAndAbandonContext() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix no-gpu build, add null check, add unit test" Created 4 years, 8 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/gl/GrGLPathRendering.h ('k') | tests/GrContextAbandonTest.cpp » ('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 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
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
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 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLPathRendering.h ('k') | tests/GrContextAbandonTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698