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

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

Issue 2467593002: Move memoization of multisample specs id to GrRenderTarget (Closed)
Patch Set: Move memoization of multisample specs id to GrRenderTarget Created 4 years, 1 month 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/GrGpu.cpp ('k') | src/gpu/GrRenderTargetPriv.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 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 8
9 #include "GrRenderTarget.h" 9 #include "GrRenderTarget.h"
10 10
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 } 98 }
99 return true; 99 return true;
100 } 100 }
101 101
102 int GrRenderTargetPriv::numStencilBits() const { 102 int GrRenderTargetPriv::numStencilBits() const {
103 return fRenderTarget->fStencilAttachment ? fRenderTarget->fStencilAttachment ->bits() : 0; 103 return fRenderTarget->fStencilAttachment ? fRenderTarget->fStencilAttachment ->bits() : 0;
104 } 104 }
105 105
106 const GrGpu::MultisampleSpecs& 106 const GrGpu::MultisampleSpecs&
107 GrRenderTargetPriv::getMultisampleSpecs(const GrStencilSettings& stencil) const { 107 GrRenderTargetPriv::getMultisampleSpecs(const GrStencilSettings& stencil) const {
108 return fRenderTarget->getGpu()->getMultisampleSpecs(fRenderTarget, stencil); 108 GrGpu* gpu = fRenderTarget->getGpu();
109 if (auto id = fRenderTarget->fMultisampleSpecsID) {
110 SkASSERT(gpu->queryMultisampleSpecs(fRenderTarget, stencil).fUniqueID == id);
111 return gpu->getMultisampleSpecs(id);
112 }
113 const GrGpu::MultisampleSpecs& specs = gpu->queryMultisampleSpecs(fRenderTar get, stencil);
114 fRenderTarget->fMultisampleSpecsID = specs.fUniqueID;
115 return specs;
109 } 116 }
110 117
111 int GrRenderTargetPriv::maxWindowRectangles() const { 118 int GrRenderTargetPriv::maxWindowRectangles() const {
112 return (this->flags() & Flags::kWindowRectsSupport) ? 119 return (this->flags() & Flags::kWindowRectsSupport) ?
113 fRenderTarget->getGpu()->caps()->maxWindowRectangles() : 0; 120 fRenderTarget->getGpu()->caps()->maxWindowRectangles() : 0;
114 } 121 }
OLDNEW
« no previous file with comments | « src/gpu/GrGpu.cpp ('k') | src/gpu/GrRenderTargetPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698