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

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

Issue 1083133002: Rename GrStencilBuffer to GrStencilAttachment (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Align data member Created 5 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/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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 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 9
10 #include "GrRenderTarget.h" 10 #include "GrRenderTarget.h"
11 11
12 #include "GrContext.h" 12 #include "GrContext.h"
13 #include "GrGpu.h" 13 #include "GrGpu.h"
14 #include "GrRenderTargetPriv.h" 14 #include "GrRenderTargetPriv.h"
15 #include "GrStencilBuffer.h" 15 #include "GrStencilAttachment.h"
16 16
17 void GrRenderTarget::discard() { 17 void GrRenderTarget::discard() {
18 // go through context so that all necessary flushing occurs 18 // go through context so that all necessary flushing occurs
19 GrContext* context = this->getContext(); 19 GrContext* context = this->getContext();
20 if (NULL == context) { 20 if (NULL == context) {
21 return; 21 return;
22 } 22 }
23 context->discardRenderTarget(this); 23 context->discardRenderTarget(this);
24 } 24 }
25 25
(...skipping 15 matching lines...) Expand all
41 if (fResolveRect.isEmpty()) { 41 if (fResolveRect.isEmpty()) {
42 fResolveRect.setLargestInverted(); 42 fResolveRect.setLargestInverted();
43 } else { 43 } else {
44 if (!fResolveRect.intersect(0, 0, this->width(), this->height())) { 44 if (!fResolveRect.intersect(0, 0, this->width(), this->height())) {
45 fResolveRect.setLargestInverted(); 45 fResolveRect.setLargestInverted();
46 } 46 }
47 } 47 }
48 } 48 }
49 49
50 void GrRenderTarget::onRelease() { 50 void GrRenderTarget::onRelease() {
51 this->renderTargetPriv().didAttachStencilBuffer(NULL); 51 this->renderTargetPriv().didAttachStencilAttachment(NULL);
52 52
53 INHERITED::onRelease(); 53 INHERITED::onRelease();
54 } 54 }
55 55
56 void GrRenderTarget::onAbandon() { 56 void GrRenderTarget::onAbandon() {
57 this->renderTargetPriv().didAttachStencilBuffer(NULL); 57 this->renderTargetPriv().didAttachStencilAttachment(NULL);
58 58
59 INHERITED::onAbandon(); 59 INHERITED::onAbandon();
60 } 60 }
61 61
62 /////////////////////////////////////////////////////////////////////////////// 62 ///////////////////////////////////////////////////////////////////////////////
63 63
64 void GrRenderTargetPriv::didAttachStencilBuffer(GrStencilBuffer* stencilBuffer) { 64 void GrRenderTargetPriv::didAttachStencilAttachment(GrStencilAttachment* stencil Attachment) {
65 SkRefCnt_SafeAssign(fRenderTarget->fStencilBuffer, stencilBuffer); 65 SkRefCnt_SafeAssign(fRenderTarget->fStencilAttachment, stencilAttachment);
66 } 66 }
67 67
68 GrStencilBuffer* GrRenderTargetPriv::attachStencilBuffer() const { 68 GrStencilAttachment* GrRenderTargetPriv::attachStencilAttachment() const {
69 if (fRenderTarget->fStencilBuffer) { 69 if (fRenderTarget->fStencilAttachment) {
70 return fRenderTarget->fStencilBuffer; 70 return fRenderTarget->fStencilAttachment;
71 } 71 }
72 if (!fRenderTarget->wasDestroyed() && fRenderTarget->canAttemptStencilAttach ment()) { 72 if (!fRenderTarget->wasDestroyed() && fRenderTarget->canAttemptStencilAttach ment()) {
73 fRenderTarget->getGpu()->attachStencilBufferToRenderTarget(fRenderTarget ); 73 fRenderTarget->getGpu()->attachStencilAttachmentToRenderTarget(fRenderTa rget);
74 } 74 }
75 return fRenderTarget->fStencilBuffer; 75 return fRenderTarget->fStencilAttachment;
76 } 76 }
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