Home | History | Annotate | Download | only in gl

Lines Matching refs:Desc

357 GrTexture* GrGpuGL::onWrapBackendTexture(const GrBackendTextureDesc& desc) {
358 if (!this->configToGLFormats(desc.fConfig, false, NULL, NULL, NULL)) {
362 if (0 == desc.fTextureHandle) {
367 if (desc.fWidth > maxSize || desc.fHeight > maxSize) {
371 GrGLTexture::Desc glTexDesc;
373 glTexDesc.fFlags = (GrTextureFlags) desc.fFlags;
374 glTexDesc.fWidth = desc.fWidth;
375 glTexDesc.fHeight = desc.fHeight;
376 glTexDesc.fConfig = desc.fConfig;
377 glTexDesc.fSampleCnt = desc.fSampleCnt;
378 glTexDesc.fTextureID = static_cast<GrGLuint>(desc.fTextureHandle);
380 bool renderTarget = SkToBool(desc.fFlags & kRenderTarget_GrBackendTextureFlag);
384 // glTexDesc.fOrigin = resolve_origin(desc.fOrigin, renderTarget);
385 if (kDefault_GrSurfaceOrigin == desc.fOrigin) {
388 glTexDesc.fOrigin = desc.fOrigin;
393 GrGLRenderTarget::Desc glRTDesc;
397 glRTDesc.fConfig = desc.fConfig;
398 glRTDesc.fSampleCnt = desc.fSampleCnt;
418 GrRenderTarget* GrGpuGL::onWrapBackendRenderTarget(const GrBackendRenderTargetDesc& desc) {
419 GrGLRenderTarget::Desc glDesc;
420 glDesc.fConfig = desc.fConfig;
421 glDesc.fRTFBOID = static_cast<GrGLuint>(desc.fRenderTargetHandle);
424 glDesc.fSampleCnt = desc.fSampleCnt;
428 glDesc.fOrigin = resolve_origin(desc.fOrigin, true);
432 viewport.fWidth = desc.fWidth;
433 viewport.fHeight = desc.fHeight;
437 if (desc.fStencilBits) {
441 format.fStencilBits = desc.fStencilBits;
442 format.fTotalBits = desc.fStencilBits;
448 desc.fWidth,
449 desc.fHeight,
450 desc.fSampleCnt,
471 GrGLTexture::Desc desc;
472 desc.fFlags = glTex->desc().fFlags;
473 desc.fWidth = glTex->width();
474 desc.fHeight = glTex->height();
475 desc.fConfig = glTex->config();
476 desc.fSampleCnt = glTex->desc().fSampleCnt;
477 desc.fTextureID = glTex->textureID();
478 desc.fOrigin = glTex->origin();
481 if (GrPixelConfigIsCompressed(desc.fConfig)) {
482 // We check that config == desc.fConfig in GrGpuGL::canWriteTexturePixels()
483 SkASSERT(config == desc.fConfig);
484 success = this->uploadCompressedTexData(desc, buffer, false,
487 success = this->uploadTexData(desc, false,
527 GrGLenum check_alloc_error(const GrTextureDesc& desc, const GrGLInterface* interface) {
528 if (SkToBool(desc.fFlags & kCheckAllocation_GrTextureFlagBit)) {
537 bool GrGpuGL::uploadTexData(const GrGLTexture::Desc& desc,
549 if (!adjust_pixel_ops_params(desc.fWidth, desc.fHeight, bpp, &left, &top,
565 kIndex_8_GrPixelConfig != desc.fConfig &&
573 useTexStorage = desc.fConfig != kRGB_565_GrPixelConfig;
603 if (kBottomLeft_GrSurfaceOrigin == desc.fOrigin) {
647 desc.fWidth == width && desc.fHeight == height) {
655 desc.fWidth, desc.fHeight));
658 GrGLsizei imageSize = desc.fWidth * desc.fHeight +
664 desc.fWidth, desc.fHeight,
673 desc.fWidth, desc.fHeight,
679 GrGLenum error = check_alloc_error(desc, this->glInterface());
696 top = desc.fHeight - (top + height);
716 // then set width = desc.fWdith ... blah. A better way to do it might be to
717 // create a CompressedTexData struct that takes a desc/ptr and figures out
720 bool GrGpuGL::uploadCompressedTexData(const GrGLTexture::Desc& desc,
727 SkASSERT(kBottomLeft_GrSurfaceOrigin != desc.fOrigin);
730 width = desc.fWidth;
734 SkASSERT(width <= desc.fWidth);
739 height = desc.fHeight;
743 SkASSERT(height <= desc.fHeight);
749 int dataSize = GrCompressedFormatDataSize(desc.fConfig, width, height);
753 if (!this->configToGLFormats(desc.fConfig, false, &internalFormat, NULL, NULL)) {
780 GrGLenum error = check_alloc_error(desc, this->glInterface());
827 GrGLRenderTarget::Desc* desc) {
828 desc->fMSColorRenderbufferID = 0;
829 desc->fRTFBOID = 0;
830 desc->fTexFBOID = 0;
831 desc->fIsWrapped = false;
837 if (desc->fSampleCnt > 0 && GrGLCaps::kNone_MSFBOType == this->glCaps().msFBOType()) {
841 GL_CALL(GenFramebuffers(1, &desc->fTexFBOID));
842 if (!desc->fTexFBOID) {
851 if (desc->fSampleCnt > 0 && this->glCaps().usesMSAARenderBuffers()) {
852 GL_CALL(GenFramebuffers(1, &desc->fRTFBOID));
853 GL_CALL(GenRenderbuffers(1, &desc->fMSColorRenderbufferID));
854 if (!desc->fRTFBOID ||
855 !desc->fMSColorRenderbufferID ||
856 !this->configToGLFormats(desc->fConfig,
865 desc->fRTFBOID = desc->fTexFBOID;
870 if (desc->fRTFBOID != desc->fTexFBOID) {
871 SkASSERT(desc->fSampleCnt > 0);
873 desc->fMSColorRenderbufferID));
875 desc->fSampleCnt,
880 GL_CALL(BindFramebuffer(GR_GL_FRAMEBUFFER, desc->fRTFBOID));
884 desc->fMSColorRenderbufferID));
885 if (desc->fCheckAllocation ||
886 !this->glCaps().isConfigVerifiedColorAttachment(desc->fConfig)) {
891 fGLContext.caps()->markConfigAsValidColorAttachment(desc->fConfig);
894 GL_CALL(BindFramebuffer(GR_GL_FRAMEBUFFER, desc->fTexFBOID));
896 if (this->glCaps().usesImplicitMSAAResolve() && desc->fSampleCnt > 0) {
900 texID, 0, desc->fSampleCnt));
907 if (desc->fCheckAllocation ||
908 !this->glCaps().isConfigVerifiedColorAttachment(desc->fConfig)) {
913 fGLContext.caps()->markConfigAsValidColorAttachment(desc->fConfig);
919 if (desc->fMSColorRenderbufferID) {
920 GL_CALL(DeleteRenderbuffers(1, &desc->fMSColorRenderbufferID));
922 if (desc->fRTFBOID != desc->fTexFBOID) {
923 GL_CALL(DeleteFramebuffers(1, &desc->fRTFBOID));
925 if (desc->fTexFBOID) {
926 GL_CALL(DeleteFramebuffers(1, &desc->fTexFBOID));
943 GrTexture* GrGpuGL::onCreateTexture(const GrTextureDesc& desc,
947 GrGLTexture::Desc glTexDesc;
948 GrGLRenderTarget::Desc glRTDesc;
951 SkASSERT(desc.fSampleCnt >= 0 && desc.fSampleCnt <= 64);
953 if (GrGLCaps::kNone_MSFBOType == this->glCaps().msFBOType() && desc.fSampleCnt) {
958 glTexDesc.fSampleCnt = SkTMin(desc.fSampleCnt, this->caps()->maxSampleCount());
960 glTexDesc.fFlags = desc.fFlags;
961 glTexDesc.fWidth = desc.fWidth;
962 glTexDesc.fHeight = desc.fHeight;
963 glTexDesc.fConfig = desc.fConfig;
971 glRTDesc.fCheckAllocation = SkToBool(desc.fFlags & kCheckAllocation_GrTextureFlagBit);
973 bool renderTarget = SkToBool(desc.fFlags & kRenderTarget_GrTextureFlagBit);
975 glTexDesc.fOrigin = resolve_origin(desc.fOrigin, renderTarget);
980 desc.fSampleCnt) {
1037 desc.fConfig, srcData, rowBytes)) {
1061 glTexDesc.fTextureID, desc.fWidth, desc.fHeight, desc.fConfig);
1066 GrTexture* GrGpuGL::onCreateCompressedTexture(const GrTextureDesc& desc,
1069 if(SkToBool(desc.fFlags & kRenderTarget_GrTextureFlagBit)) {
1074 GrSurfaceOrigin texOrigin = resolve_origin(desc.fOrigin, false);
1079 GrGLTexture::Desc glTexDesc;
1081 glTexDesc.fFlags = desc.fFlags;
1082 glTexDesc.fWidth = desc.fWidth;
1083 glTexDesc.fHeight = desc.fHeight;
1084 glTexDesc.fConfig = desc.fConfig;
1135 glTexDesc.fTextureID, desc.fWidth, desc.fHeight, desc.fConfig);
1206 (GR_GL_NO_ERROR == check_alloc_error(rt->desc(), this->glInterface()));
1295 GrGLVertexBuffer::Desc desc;
1296 desc.fDynamic = dynamic;
1297 desc.fSizeInBytes = size;
1298 desc.fIsWrapped = false;
1300 if (this->glCaps().useNonVBOVertexAndIndexDynamicData() && desc.fDynamic) {
1301 desc.fID = 0;
1302 GrGLVertexBuffer* vertexBuffer = SkNEW_ARGS(GrGLVertexBuffer, (this, desc));
1305 GL_CALL(GenBuffers(1, &desc.fID));
1306 if (desc.fID) {
1307 fHWGeometryState.setVertexBufferID(this, desc.fID);
1312 (GrGLsizeiptr) desc.fSizeInBytes,
1314 desc.fDynamic ? GR_GL_DYNAMIC_DRAW : GR_GL_STATIC_DRAW));
1316 GL_CALL(DeleteBuffers(1, &desc.fID));
1317 this->notifyVertexBufferDelete(desc.fID);
1320 GrGLVertexBuffer* vertexBuffer = SkNEW_ARGS(GrGLVertexBuffer, (this, desc));
1328 GrGLIndexBuffer::Desc desc;
1329 desc.fDynamic = dynamic;
1330 desc.fSizeInBytes = size;
1331 desc.fIsWrapped = false;
1333 if (this->glCaps().useNonVBOVertexAndIndexDynamicData() && desc.fDynamic) {
1334 desc.fID = 0;
1335 GrIndexBuffer* indexBuffer = SkNEW_ARGS(GrGLIndexBuffer, (this, desc));
1338 GL_CALL(GenBuffers(1, &desc.fID));
1339 if (desc.fID) {
1340 fHWGeometryState.setIndexBufferIDOnDefaultVertexArray(this, desc.fID);
1345 (GrGLsizeiptr) desc.fSizeInBytes,
1347 desc.fDynamic ? GR_GL_DYNAMIC_DRAW : GR_GL_STATIC_DRAW));
1349 GL_CALL(DeleteBuffers(1, &desc.fID));
1350 this->notifyIndexBufferDelete(desc.fID);
1353 GrIndexBuffer* indexBuffer = SkNEW_ARGS(GrGLIndexBuffer, (this, desc));
2729 if (gpu->glCaps().isConfigRenderable(dst->config(), dst->desc().fSampleCnt > 0) &&
2730 gpu->glCaps().isConfigRenderable(src->config(), src->desc().fSampleCnt > 0) &&
2735 (src->desc().fSampleCnt > 0 || src->config() != dst->config())) {
2770 if (gpu->glCaps().isConfigRenderable(src->config(), src->desc().fSampleCnt > 0) &&
2816 void GrGpuGL::initCopySurfaceDstDesc(const GrSurface* src, GrTextureDesc* desc) {
2822 INHERITED::initCopySurfaceDstDesc(src, desc);
2827 INHERITED::initCopySurfaceDstDesc(src, desc);
2834 INHERITED::initCopySurfaceDstDesc(src, desc);
2836 desc->fConfig = src->config();
2837 desc->fOrigin = src->origin();
2838 desc->fFlags = kNone_GrTextureFlags;