Lines Matching refs:desc
366 GrTexture* GrGpuGL::onWrapBackendTexture(const GrBackendTextureDesc& desc) {
367 if (!this->configToGLFormats(desc.fConfig, false, NULL, NULL, NULL)) {
371 if (0 == desc.fTextureHandle) {
376 if (desc.fWidth > maxSize || desc.fHeight > maxSize) {
380 GrGLTexture::Desc glTexDesc;
382 glTexDesc.fFlags = (GrTextureFlags) desc.fFlags;
383 glTexDesc.fWidth = desc.fWidth;
384 glTexDesc.fHeight = desc.fHeight;
385 glTexDesc.fConfig = desc.fConfig;
386 glTexDesc.fSampleCnt = desc.fSampleCnt;
387 glTexDesc.fTextureID = static_cast<GrGLuint>(desc.fTextureHandle);
389 bool renderTarget = SkToBool(desc.fFlags & kRenderTarget_GrBackendTextureFlag);
393 // glTexDesc.fOrigin = resolve_origin(desc.fOrigin, renderTarget);
394 if (kDefault_GrSurfaceOrigin == desc.fOrigin) {
397 glTexDesc.fOrigin = desc.fOrigin;
402 GrGLRenderTarget::Desc glRTDesc;
406 glRTDesc.fConfig = desc.fConfig;
407 glRTDesc.fSampleCnt = desc.fSampleCnt;
427 GrRenderTarget* GrGpuGL::onWrapBackendRenderTarget(const GrBackendRenderTargetDesc& desc) {
428 GrGLRenderTarget::Desc glDesc;
429 glDesc.fConfig = desc.fConfig;
430 glDesc.fRTFBOID = static_cast<GrGLuint>(desc.fRenderTargetHandle);
433 glDesc.fSampleCnt = desc.fSampleCnt;
437 glDesc.fOrigin = resolve_origin(desc.fOrigin, true);
441 viewport.fWidth = desc.fWidth;
442 viewport.fHeight = desc.fHeight;
446 if (desc.fStencilBits) {
450 format.fStencilBits = desc.fStencilBits;
451 format.fTotalBits = desc.fStencilBits;
457 desc.fWidth,
458 desc.fHeight,
459 desc.fSampleCnt,
480 GrGLTexture::Desc desc;
481 desc.fFlags = glTex->desc().fFlags;
482 desc.fWidth = glTex->width();
483 desc.fHeight = glTex->height();
484 desc.fConfig = glTex->config();
485 desc.fSampleCnt = glTex->desc().fSampleCnt;
486 desc.fTextureID = glTex->textureID();
487 desc.fOrigin = glTex->origin();
489 if (this->uploadTexData(desc, false,
526 GrGLenum check_alloc_error(const GrTextureDesc& desc, const GrGLInterface* interface) {
527 if (SkToBool(desc.fFlags & kCheckAllocation_GrTextureFlagBit)) {
536 bool GrGpuGL::uploadTexData(const GrGLTexture::Desc& desc,
545 if (!adjust_pixel_ops_params(desc.fWidth, desc.fHeight, bpp, &left, &top,
561 desc.fConfig != kIndex_8_GrPixelConfig &&
569 useTexStorage = desc.fConfig != kRGB_565_GrPixelConfig;
599 if (kBottomLeft_GrSurfaceOrigin == desc.fOrigin) {
643 desc.fWidth == width && desc.fHeight == height) {
651 desc.fWidth, desc.fHeight));
654 GrGLsizei imageSize = desc.fWidth * desc.fHeight +
660 desc.fWidth, desc.fHeight,
669 desc.fWidth, desc.fHeight,
675 GrGLenum error = check_alloc_error(desc, this->glInterface());
692 top = desc.fHeight - (top + height);
759 GrGLRenderTarget::Desc* desc) {
760 desc->fMSColorRenderbufferID = 0;
761 desc->fRTFBOID = 0;
762 desc->fTexFBOID = 0;
763 desc->fIsWrapped = false;
769 if (desc->fSampleCnt > 0 && GrGLCaps::kNone_MSFBOType == this->glCaps().msFBOType()) {
773 GL_CALL(GenFramebuffers(1, &desc->fTexFBOID));
774 if (!desc->fTexFBOID) {
783 if (desc->fSampleCnt > 0 && this->glCaps().usesMSAARenderBuffers()) {
784 GL_CALL(GenFramebuffers(1, &desc->fRTFBOID));
785 GL_CALL(GenRenderbuffers(1, &desc->fMSColorRenderbufferID));
786 if (!desc->fRTFBOID ||
787 !desc->fMSColorRenderbufferID ||
788 !this->configToGLFormats(desc->fConfig,
797 desc->fRTFBOID = desc->fTexFBOID;
802 if (desc->fRTFBOID != desc->fTexFBOID) {
803 SkASSERT(desc->fSampleCnt > 0);
805 desc->fMSColorRenderbufferID));
807 desc->fSampleCnt,
812 GL_CALL(BindFramebuffer(GR_GL_FRAMEBUFFER, desc->fRTFBOID));
816 desc->fMSColorRenderbufferID));
817 if (desc->fCheckAllocation ||
818 !this->glCaps().isConfigVerifiedColorAttachment(desc->fConfig)) {
823 fGLContext.info().caps()->markConfigAsValidColorAttachment(desc->fConfig);
826 GL_CALL(BindFramebuffer(GR_GL_FRAMEBUFFER, desc->fTexFBOID));
828 if (this->glCaps().usesImplicitMSAAResolve() && desc->fSampleCnt > 0) {
832 texID, 0, desc->fSampleCnt));
839 if (desc->fCheckAllocation ||
840 !this->glCaps().isConfigVerifiedColorAttachment(desc->fConfig)) {
845 fGLContext.info().caps()->markConfigAsValidColorAttachment(desc->fConfig);
851 if (desc->fMSColorRenderbufferID) {
852 GL_CALL(DeleteRenderbuffers(1, &desc->fMSColorRenderbufferID));
854 if (desc->fRTFBOID != desc->fTexFBOID) {
855 GL_CALL(DeleteFramebuffers(1, &desc->fRTFBOID));
857 if (desc->fTexFBOID) {
858 GL_CALL(DeleteFramebuffers(1, &desc->fTexFBOID));
875 GrTexture* GrGpuGL::onCreateTexture(const GrTextureDesc& desc,
879 GrGLTexture::Desc glTexDesc;
880 GrGLRenderTarget::Desc glRTDesc;
883 SkASSERT(desc.fSampleCnt >= 0 && desc.fSampleCnt <= 64);
885 if (GrGLCaps::kNone_MSFBOType == this->glCaps().msFBOType() && desc.fSampleCnt) {
890 glTexDesc.fSampleCnt = GrMin(desc.fSampleCnt, this->caps()->maxSampleCount());
892 glTexDesc.fFlags = desc.fFlags;
893 glTexDesc.fWidth = desc.fWidth;
894 glTexDesc.fHeight = desc.fHeight;
895 glTexDesc.fConfig = desc.fConfig;
903 glRTDesc.fCheckAllocation = SkToBool(desc.fFlags & kCheckAllocation_GrTextureFlagBit);
905 bool renderTarget = SkToBool(desc.fFlags & kRenderTarget_GrTextureFlagBit);
907 glTexDesc.fOrigin = resolve_origin(desc.fOrigin, renderTarget);
912 desc.fSampleCnt) {
969 desc.fConfig, srcData, rowBytes)) {
993 glTexDesc.fTextureID, desc.fWidth, desc.fHeight, desc.fConfig);
1064 (GR_GL_NO_ERROR == check_alloc_error(rt->desc(), this->glInterface()));
1153 GrGLVertexBuffer::Desc desc;
1154 desc.fDynamic = dynamic;
1155 desc.fSizeInBytes = size;
1156 desc.fIsWrapped = false;
1158 if (this->glCaps().useNonVBOVertexAndIndexDynamicData() && desc.fDynamic) {
1159 desc.fID = 0;
1160 GrGLVertexBuffer* vertexBuffer = SkNEW_ARGS(GrGLVertexBuffer, (this, desc));
1163 GL_CALL(GenBuffers(1, &desc.fID));
1164 if (desc.fID) {
1165 fHWGeometryState.setVertexBufferID(this, desc.fID);
1170 (GrGLsizeiptr) desc.fSizeInBytes,
1172 desc.fDynamic ? GR_GL_DYNAMIC_DRAW : GR_GL_STATIC_DRAW));
1174 GL_CALL(DeleteBuffers(1, &desc.fID));
1175 this->notifyVertexBufferDelete(desc.fID);
1178 GrGLVertexBuffer* vertexBuffer = SkNEW_ARGS(GrGLVertexBuffer, (this, desc));
1186 GrGLIndexBuffer::Desc desc;
1187 desc.fDynamic = dynamic;
1188 desc.fSizeInBytes = size;
1189 desc.fIsWrapped = false;
1191 if (this->glCaps().useNonVBOVertexAndIndexDynamicData() && desc.fDynamic) {
1192 desc.fID = 0;
1193 GrIndexBuffer* indexBuffer = SkNEW_ARGS(GrGLIndexBuffer, (this, desc));
1196 GL_CALL(GenBuffers(1, &desc.fID));
1197 if (desc.fID) {
1198 fHWGeometryState.setIndexBufferIDOnDefaultVertexArray(this, desc.fID);
1203 (GrGLsizeiptr) desc.fSizeInBytes,
1205 desc.fDynamic ? GR_GL_DYNAMIC_DRAW : GR_GL_STATIC_DRAW));
1207 GL_CALL(DeleteBuffers(1, &desc.fID));
1208 this->notifyIndexBufferDelete(desc.fID);
1211 GrIndexBuffer* indexBuffer = SkNEW_ARGS(GrGLIndexBuffer, (this, desc));
2420 if (gpu->glCaps().isConfigRenderable(dst->config(), dst->desc().fSampleCnt > 0) &&
2421 gpu->glCaps().isConfigRenderable(src->config(), src->desc().fSampleCnt > 0) &&
2426 (src->desc().fSampleCnt > 0 || src->config() != dst->config())) {
2461 if (gpu->glCaps().isConfigRenderable(src->config(), src->desc().fSampleCnt > 0) &&
2506 void GrGpuGL::initCopySurfaceDstDesc(const GrSurface* src, GrTextureDesc* desc) {
2512 INHERITED::initCopySurfaceDstDesc(src, desc);
2517 INHERITED::initCopySurfaceDstDesc(src, desc);
2524 INHERITED::initCopySurfaceDstDesc(src, desc);
2526 desc->fConfig = src->config();
2527 desc->fOrigin = src->origin();
2528 desc->fFlags = kNone_GrTextureFlags;