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

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

Issue 2225303002: Add flag for window rectangles to GrRenderTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add GrRenderTarget flag for window rectangles Created 4 years, 4 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 | « include/private/GrRenderTargetProxy.h ('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
11 #include "GrContext.h" 11 #include "GrContext.h"
12 #include "GrContextPriv.h" 12 #include "GrContextPriv.h"
13 #include "GrDrawContext.h" 13 #include "GrDrawContext.h"
14 #include "GrDrawTarget.h" 14 #include "GrDrawTarget.h"
15 #include "GrGpu.h" 15 #include "GrGpu.h"
16 #include "GrRenderTargetPriv.h" 16 #include "GrRenderTargetPriv.h"
17 #include "GrStencilAttachment.h" 17 #include "GrStencilAttachment.h"
18 18
19 GrRenderTarget::GrRenderTarget(GrGpu* gpu, const GrSurfaceDesc& desc, Flags flag s,
20 GrStencilAttachment* stencil)
21 : INHERITED(gpu, desc)
22 , fStencilAttachment(stencil)
23 , fMultisampleSpecsID(0)
24 , fFlags(flags)
25 , fLastDrawTarget(nullptr) {
26 SkASSERT(!(fFlags & Flags::kMixedSampled) || fDesc.fSampleCnt > 0);
27 SkASSERT(!(fFlags & Flags::kWindowRectsSupport) || gpu->caps()->maxWindowRec tangles() > 0);
28 fResolveRect.setLargestInverted();
29 }
30
19 GrRenderTarget::~GrRenderTarget() { 31 GrRenderTarget::~GrRenderTarget() {
20 if (fLastDrawTarget) { 32 if (fLastDrawTarget) {
21 fLastDrawTarget->clearRT(); 33 fLastDrawTarget->clearRT();
22 } 34 }
23 SkSafeUnref(fLastDrawTarget); 35 SkSafeUnref(fLastDrawTarget);
24 } 36 }
25 37
26 void GrRenderTarget::discard() { 38 void GrRenderTarget::discard() {
27 // go through context so that all necessary flushing occurs 39 // go through context so that all necessary flushing occurs
28 GrContext* context = this->getContext(); 40 GrContext* context = this->getContext();
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 } 120 }
109 121
110 int GrRenderTargetPriv::numStencilBits() const { 122 int GrRenderTargetPriv::numStencilBits() const {
111 return fRenderTarget->fStencilAttachment ? fRenderTarget->fStencilAttachment ->bits() : 0; 123 return fRenderTarget->fStencilAttachment ? fRenderTarget->fStencilAttachment ->bits() : 0;
112 } 124 }
113 125
114 const GrGpu::MultisampleSpecs& 126 const GrGpu::MultisampleSpecs&
115 GrRenderTargetPriv::getMultisampleSpecs(const GrStencilSettings& stencil) const { 127 GrRenderTargetPriv::getMultisampleSpecs(const GrStencilSettings& stencil) const {
116 return fRenderTarget->getGpu()->getMultisampleSpecs(fRenderTarget, stencil); 128 return fRenderTarget->getGpu()->getMultisampleSpecs(fRenderTarget, stencil);
117 } 129 }
118
119 GrRenderTarget::SampleConfig GrRenderTarget::ComputeSampleConfig(const GrCaps& c aps,
120 int sampleCnt) {
121 return (caps.usesMixedSamples() && sampleCnt > 0)
122 ? GrRenderTarget::kStencil_SampleConfig
123 : GrRenderTarget::kUnified_SampleConfig;
124 }
125
OLDNEW
« no previous file with comments | « include/private/GrRenderTargetProxy.h ('k') | src/gpu/GrRenderTargetPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698