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

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

Issue 685883003: Clip in grdrawtarget (Closed) Base URL: https://skia.googlesource.com/skia.git@drawtarget_on_clip_manager
Patch Set: add ccclip to ignore Created 6 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/gl/GrGpuGL.h ('k') | tests/GLProgramsTest.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 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 "builders/GrGLProgramBuilder.h" 10 #include "builders/GrGLProgramBuilder.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 this->flushBlend(*optState.get(), kDrawLines_DrawType == type, srcCoeff, dstCoeff); 250 this->flushBlend(*optState.get(), kDrawLines_DrawType == type, srcCoeff, dstCoeff);
251 251
252 fCurrentProgram->setData(*optState.get(), type, dstCopy); 252 fCurrentProgram->setData(*optState.get(), type, dstCopy);
253 } 253 }
254 254
255 GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(optState->getRenderT arget()); 255 GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(optState->getRenderT arget());
256 this->flushStencil(optState->getStencil(), type); 256 this->flushStencil(optState->getStencil(), type);
257 this->flushScissor(scissorState, glRT->getViewport(), glRT->origin()); 257 this->flushScissor(scissorState, glRT->getViewport(), glRT->origin());
258 this->flushAAState(*optState.get(), type); 258 this->flushAAState(*optState.get(), type);
259 259
260 SkIRect* devRect = NULL;
261 SkIRect devClipBounds;
262 if (optState->isClipState()) {
263 this->getClip()->getConservativeBounds(optState->getRenderTarget(), &dev ClipBounds);
264 devRect = &devClipBounds;
265 }
266 // This must come after textures are flushed because a texture may need 260 // This must come after textures are flushed because a texture may need
267 // to be msaa-resolved (which will modify bound FBO state). 261 // to be msaa-resolved (which will modify bound FBO state).
268 this->flushRenderTarget(glRT, devRect); 262 this->flushRenderTarget(glRT, NULL);
269 263
270 return true; 264 return true;
271 } 265 }
272 266
273 void GrGpuGL::setupGeometry(const DrawInfo& info, size_t* indexOffsetInBytes) { 267 void GrGpuGL::setupGeometry(const DrawInfo& info, size_t* indexOffsetInBytes) {
274 SkAutoTUnref<GrOptDrawState> optState( 268 SkAutoTUnref<GrOptDrawState> optState(
275 GrOptDrawState::Create(this->getDrawState(), this, info.getDstCopy(), 269 GrOptDrawState::Create(this->getDrawState(), this, info.getDstCopy(),
276 PrimTypeToDrawType(info.primitiveType()))); 270 PrimTypeToDrawType(info.primitiveType())));
277 271
278 // If the optState would is NULL it should have been caught in flushGraphics State before getting 272 // If the optState would is NULL it should have been caught in flushGraphics State before getting
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 349
356 void GrGpuGL::buildProgramDesc(const GrOptDrawState& optState, 350 void GrGpuGL::buildProgramDesc(const GrOptDrawState& optState,
357 const GrProgramDesc::DescInfo& descInfo, 351 const GrProgramDesc::DescInfo& descInfo,
358 GrGpu::DrawType drawType, 352 GrGpu::DrawType drawType,
359 const GrDeviceCoordTexture* dstCopy, 353 const GrDeviceCoordTexture* dstCopy,
360 GrProgramDesc* desc) { 354 GrProgramDesc* desc) {
361 if (!GrGLProgramDescBuilder::Build(optState, descInfo, drawType, this, dstCo py, desc)) { 355 if (!GrGLProgramDescBuilder::Build(optState, descInfo, drawType, this, dstCo py, desc)) {
362 SkDEBUGFAIL("Failed to generate GL program descriptor"); 356 SkDEBUGFAIL("Failed to generate GL program descriptor");
363 } 357 }
364 } 358 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGpuGL.h ('k') | tests/GLProgramsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698