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

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

Issue 533883004: Remove GrDrawTarget::AutoRenderTargetRestore. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: pass rt to clearStencilClip Created 6 years, 3 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
« src/gpu/gl/GrGpuGL.h ('K') | « src/gpu/gl/GrGpuGL.cpp ('k') | no next file » | 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 #include "GrGpuGL.h" 8 #include "GrGpuGL.h"
9 9
10 #include "GrEffect.h" 10 #include "GrEffect.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 fCurrentProgram->overrideBlend(&srcCoeff, &dstCoeff); 258 fCurrentProgram->overrideBlend(&srcCoeff, &dstCoeff);
259 this->flushBlend(kDrawLines_DrawType == type, srcCoeff, dstCoeff); 259 this->flushBlend(kDrawLines_DrawType == type, srcCoeff, dstCoeff);
260 260
261 fCurrentProgram->setData(type, 261 fCurrentProgram->setData(type,
262 blendOpts, 262 blendOpts,
263 colorStages.begin(), 263 colorStages.begin(),
264 coverageStages.begin(), 264 coverageStages.begin(),
265 dstCopy, 265 dstCopy,
266 &fSharedGLProgramState); 266 &fSharedGLProgramState);
267 } 267 }
268
269 GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(drawState.getRenderT arget());
268 this->flushStencil(type); 270 this->flushStencil(type);
269 this->flushScissor(); 271 this->flushScissor(glRT->getViewport(), glRT->origin());
270 this->flushAAState(type); 272 this->flushAAState(type);
271 273
272 SkIRect* devRect = NULL; 274 SkIRect* devRect = NULL;
273 SkIRect devClipBounds; 275 SkIRect devClipBounds;
274 if (drawState.isClipState()) { 276 if (drawState.isClipState()) {
275 this->getClip()->getConservativeBounds(drawState.getRenderTarget(), &dev ClipBounds); 277 this->getClip()->getConservativeBounds(drawState.getRenderTarget(), &dev ClipBounds);
276 devRect = &devClipBounds; 278 devRect = &devClipBounds;
277 } 279 }
278 // This must come after textures are flushed because a texture may need 280 // This must come after textures are flushed because a texture may need
279 // to be msaa-resolved (which will modify bound FBO state). 281 // to be msaa-resolved (which will modify bound FBO state).
280 this->flushRenderTarget(devRect); 282 this->flushRenderTarget(glRT, devRect);
281 283
282 return true; 284 return true;
283 } 285 }
284 286
285 void GrGpuGL::setupGeometry(const DrawInfo& info, size_t* indexOffsetInBytes) { 287 void GrGpuGL::setupGeometry(const DrawInfo& info, size_t* indexOffsetInBytes) {
286 288
287 GrGLsizei stride = static_cast<GrGLsizei>(this->getDrawState().getVertexStri de()); 289 GrGLsizei stride = static_cast<GrGLsizei>(this->getDrawState().getVertexStri de());
288 290
289 size_t vertexOffsetInBytes = stride * info.startVertex(); 291 size_t vertexOffsetInBytes = stride * info.startVertex();
290 292
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 GrGLAttribTypeToLayout(attribType).fType, 359 GrGLAttribTypeToLayout(attribType).fType,
358 GrGLAttribTypeToLayout(attribType).fNormalized, 360 GrGLAttribTypeToLayout(attribType).fNormalized,
359 stride, 361 stride,
360 reinterpret_cast<GrGLvoid*>( 362 reinterpret_cast<GrGLvoid*>(
361 vertexOffsetInBytes + vertexAttrib->fOffset)); 363 vertexOffsetInBytes + vertexAttrib->fOffset));
362 } 364 }
363 } 365 }
364 attribState->disableUnusedArrays(this, usedAttribArraysMask); 366 attribState->disableUnusedArrays(this, usedAttribArraysMask);
365 } 367 }
366 } 368 }
OLDNEW
« src/gpu/gl/GrGpuGL.h ('K') | « src/gpu/gl/GrGpuGL.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698