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

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: dm cleaned up 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
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 351
358 void GrGpuGL::buildProgramDesc(const GrOptDrawState& optState, 352 void GrGpuGL::buildProgramDesc(const GrOptDrawState& optState,
359 const GrProgramDesc::DescInfo& descInfo, 353 const GrProgramDesc::DescInfo& descInfo,
360 GrGpu::DrawType drawType, 354 GrGpu::DrawType drawType,
361 const GrDeviceCoordTexture* dstCopy, 355 const GrDeviceCoordTexture* dstCopy,
362 GrProgramDesc* desc) { 356 GrProgramDesc* desc) {
363 if (!GrGLProgramDescBuilder::Build(optState, descInfo, drawType, this, dstCo py, desc)) { 357 if (!GrGLProgramDescBuilder::Build(optState, descInfo, drawType, this, dstCo py, desc)) {
364 SkDEBUGFAIL("Failed to generate GL program descriptor"); 358 SkDEBUGFAIL("Failed to generate GL program descriptor");
365 } 359 }
366 } 360 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698