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

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

Issue 1301583006: Add rendertarget flag to prevent a debug assert in SampleApp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 | « no previous file | 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 8
9 #include "GrGLGpu.h" 9 #include "GrGLGpu.h"
10 #include "GrGLGLSL.h" 10 #include "GrGLGLSL.h"
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 idDesc.fLifeCycle = GrGpuResource::kAdopted_LifeCycle; 471 idDesc.fLifeCycle = GrGpuResource::kAdopted_LifeCycle;
472 break; 472 break;
473 case kBorrow_GrWrapOwnership: 473 case kBorrow_GrWrapOwnership:
474 idDesc.fLifeCycle = GrGpuResource::kBorrowed_LifeCycle; 474 idDesc.fLifeCycle = GrGpuResource::kBorrowed_LifeCycle;
475 break; 475 break;
476 } 476 }
477 idDesc.fSampleConfig = GrRenderTarget::kUnified_SampleConfig; 477 idDesc.fSampleConfig = GrRenderTarget::kUnified_SampleConfig;
478 478
479 GrSurfaceDesc desc; 479 GrSurfaceDesc desc;
480 desc.fConfig = wrapDesc.fConfig; 480 desc.fConfig = wrapDesc.fConfig;
481 desc.fFlags = kCheckAllocation_GrSurfaceFlag; 481 desc.fFlags = kCheckAllocation_GrSurfaceFlag | kRenderTarget_GrSurfaceFlag;
482 desc.fWidth = wrapDesc.fWidth; 482 desc.fWidth = wrapDesc.fWidth;
483 desc.fHeight = wrapDesc.fHeight; 483 desc.fHeight = wrapDesc.fHeight;
484 desc.fSampleCnt = SkTMin(wrapDesc.fSampleCnt, this->caps()->maxSampleCount() ); 484 desc.fSampleCnt = SkTMin(wrapDesc.fSampleCnt, this->caps()->maxSampleCount() );
485 desc.fOrigin = resolve_origin(wrapDesc.fOrigin, true); 485 desc.fOrigin = resolve_origin(wrapDesc.fOrigin, true);
486 486
487 GrRenderTarget* tgt = SkNEW_ARGS(GrGLRenderTarget, (this, desc, idDesc)); 487 GrRenderTarget* tgt = SkNEW_ARGS(GrGLRenderTarget, (this, desc, idDesc));
488 if (wrapDesc.fStencilBits) { 488 if (wrapDesc.fStencilBits) {
489 GrGLStencilAttachment::IDDesc sbDesc; 489 GrGLStencilAttachment::IDDesc sbDesc;
490 GrGLStencilAttachment::Format format; 490 GrGLStencilAttachment::Format format;
491 format.fInternalFormat = GrGLStencilAttachment::kUnknownInternalFormat; 491 format.fInternalFormat = GrGLStencilAttachment::kUnknownInternalFormat;
(...skipping 2704 matching lines...) Expand 10 before | Expand all | Expand 10 after
3196 this->setVertexArrayID(gpu, 0); 3196 this->setVertexArrayID(gpu, 0);
3197 } 3197 }
3198 int attrCount = gpu->glCaps().maxVertexAttributes(); 3198 int attrCount = gpu->glCaps().maxVertexAttributes();
3199 if (fDefaultVertexArrayAttribState.count() != attrCount) { 3199 if (fDefaultVertexArrayAttribState.count() != attrCount) {
3200 fDefaultVertexArrayAttribState.resize(attrCount); 3200 fDefaultVertexArrayAttribState.resize(attrCount);
3201 } 3201 }
3202 attribState = &fDefaultVertexArrayAttribState; 3202 attribState = &fDefaultVertexArrayAttribState;
3203 } 3203 }
3204 return attribState; 3204 return attribState;
3205 } 3205 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698