OLD | NEW |
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 "GrGLGpu.h" | 8 #include "GrGLGpu.h" |
9 #include "GrGLBuffer.h" | 9 #include "GrGLBuffer.h" |
10 #include "GrGLGLSL.h" | 10 #include "GrGLGLSL.h" |
(...skipping 631 matching lines...) Loading... |
642 } else if (GR_GL_TEXTURE_2D != idDesc.fInfo.fTarget) { | 642 } else if (GR_GL_TEXTURE_2D != idDesc.fInfo.fTarget) { |
643 return nullptr; | 643 return nullptr; |
644 } | 644 } |
645 | 645 |
646 // Sample count is interpreted to mean the number of samples that Gr code sh
ould allocate | 646 // Sample count is interpreted to mean the number of samples that Gr code sh
ould allocate |
647 // for a render buffer that resolves to the texture. We don't support MSAA t
extures. | 647 // for a render buffer that resolves to the texture. We don't support MSAA t
extures. |
648 if (desc.fSampleCnt && !renderTarget) { | 648 if (desc.fSampleCnt && !renderTarget) { |
649 return nullptr; | 649 return nullptr; |
650 } | 650 } |
651 | 651 |
652 switch (ownership) { | 652 if (kAdopt_GrWrapOwnership == ownership) { |
653 case kAdopt_GrWrapOwnership: | 653 idDesc.fLifeCycle = GrBackendObjectLifeCycle::kAdopted; |
654 idDesc.fLifeCycle = GrGpuResource::kAdopted_LifeCycle; | 654 } else { |
655 break; | 655 idDesc.fLifeCycle = GrBackendObjectLifeCycle::kBorrowed; |
656 case kBorrow_GrWrapOwnership: | |
657 idDesc.fLifeCycle = GrGpuResource::kBorrowed_LifeCycle; | |
658 break; | |
659 } | 656 } |
660 | 657 |
661 surfDesc.fFlags = (GrSurfaceFlags) desc.fFlags; | 658 surfDesc.fFlags = (GrSurfaceFlags) desc.fFlags; |
662 surfDesc.fWidth = desc.fWidth; | 659 surfDesc.fWidth = desc.fWidth; |
663 surfDesc.fHeight = desc.fHeight; | 660 surfDesc.fHeight = desc.fHeight; |
664 surfDesc.fConfig = desc.fConfig; | 661 surfDesc.fConfig = desc.fConfig; |
665 surfDesc.fSampleCnt = SkTMin(desc.fSampleCnt, this->caps()->maxSampleCount()
); | 662 surfDesc.fSampleCnt = SkTMin(desc.fSampleCnt, this->caps()->maxSampleCount()
); |
666 // FIXME: this should be calling resolve_origin(), but Chrome code is curre
ntly | 663 // FIXME: this should be calling resolve_origin(), but Chrome code is curre
ntly |
667 // assuming the old behaviour, which is that backend textures are always | 664 // assuming the old behaviour, which is that backend textures are always |
668 // BottomLeft, even for non-RT's. Once Chrome is fixed, change this to: | 665 // BottomLeft, even for non-RT's. Once Chrome is fixed, change this to: |
669 // glTexDesc.fOrigin = resolve_origin(desc.fOrigin, renderTarget); | 666 // glTexDesc.fOrigin = resolve_origin(desc.fOrigin, renderTarget); |
670 if (kDefault_GrSurfaceOrigin == desc.fOrigin) { | 667 if (kDefault_GrSurfaceOrigin == desc.fOrigin) { |
671 surfDesc.fOrigin = kBottomLeft_GrSurfaceOrigin; | 668 surfDesc.fOrigin = kBottomLeft_GrSurfaceOrigin; |
672 } else { | 669 } else { |
673 surfDesc.fOrigin = desc.fOrigin; | 670 surfDesc.fOrigin = desc.fOrigin; |
674 } | 671 } |
675 | 672 |
676 GrGLTexture* texture = nullptr; | 673 GrGLTexture* texture = nullptr; |
677 if (renderTarget) { | 674 if (renderTarget) { |
678 GrGLRenderTarget::IDDesc rtIDDesc; | 675 GrGLRenderTarget::IDDesc rtIDDesc; |
679 if (!this->createRenderTargetObjects(surfDesc, GrGpuResource::kUncached_
LifeCycle, | 676 if (!this->createRenderTargetObjects(surfDesc, idDesc.fInfo, &rtIDDesc))
{ |
680 idDesc.fInfo, &rtIDDesc)) { | |
681 return nullptr; | 677 return nullptr; |
682 } | 678 } |
683 texture = new GrGLTextureRenderTarget(this, surfDesc, idDesc, rtIDDesc); | 679 texture = GrGLTextureRenderTarget::CreateWrapped(this, surfDesc, idDesc,
rtIDDesc); |
684 } else { | 680 } else { |
685 texture = new GrGLTexture(this, surfDesc, idDesc); | 681 texture = GrGLTexture::CreateWrapped(this, surfDesc, idDesc); |
686 } | 682 } |
687 if (nullptr == texture) { | 683 if (nullptr == texture) { |
688 return nullptr; | 684 return nullptr; |
689 } | 685 } |
690 | 686 |
691 return texture; | 687 return texture; |
692 } | 688 } |
693 | 689 |
694 GrRenderTarget* GrGLGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDe
sc& wrapDesc, | 690 GrRenderTarget* GrGLGpu::onWrapBackendRenderTarget(const GrBackendRenderTargetDe
sc& wrapDesc, |
695 GrWrapOwnership ownership) { | 691 GrWrapOwnership ownership) { |
696 GrGLRenderTarget::IDDesc idDesc; | 692 GrGLRenderTarget::IDDesc idDesc; |
697 idDesc.fRTFBOID = static_cast<GrGLuint>(wrapDesc.fRenderTargetHandle); | 693 idDesc.fRTFBOID = static_cast<GrGLuint>(wrapDesc.fRenderTargetHandle); |
698 idDesc.fMSColorRenderbufferID = 0; | 694 idDesc.fMSColorRenderbufferID = 0; |
699 idDesc.fTexFBOID = GrGLRenderTarget::kUnresolvableFBOID; | 695 idDesc.fTexFBOID = GrGLRenderTarget::kUnresolvableFBOID; |
700 switch (ownership) { | 696 if (kAdopt_GrWrapOwnership == ownership) { |
701 case kAdopt_GrWrapOwnership: | 697 idDesc.fRTFBOLifeCycle = GrBackendObjectLifeCycle::kAdopted; |
702 idDesc.fLifeCycle = GrGpuResource::kAdopted_LifeCycle; | 698 } else { |
703 break; | 699 idDesc.fRTFBOLifeCycle = GrBackendObjectLifeCycle::kBorrowed; |
704 case kBorrow_GrWrapOwnership: | |
705 idDesc.fLifeCycle = GrGpuResource::kBorrowed_LifeCycle; | |
706 break; | |
707 } | 700 } |
708 idDesc.fSampleConfig = GrRenderTarget::kUnified_SampleConfig; | 701 idDesc.fSampleConfig = GrRenderTarget::kUnified_SampleConfig; |
709 | 702 |
710 GrSurfaceDesc desc; | 703 GrSurfaceDesc desc; |
711 desc.fConfig = wrapDesc.fConfig; | 704 desc.fConfig = wrapDesc.fConfig; |
712 desc.fFlags = kCheckAllocation_GrSurfaceFlag | kRenderTarget_GrSurfaceFlag; | 705 desc.fFlags = kCheckAllocation_GrSurfaceFlag | kRenderTarget_GrSurfaceFlag; |
713 desc.fWidth = wrapDesc.fWidth; | 706 desc.fWidth = wrapDesc.fWidth; |
714 desc.fHeight = wrapDesc.fHeight; | 707 desc.fHeight = wrapDesc.fHeight; |
715 desc.fSampleCnt = SkTMin(wrapDesc.fSampleCnt, this->caps()->maxSampleCount()
); | 708 desc.fSampleCnt = SkTMin(wrapDesc.fSampleCnt, this->caps()->maxSampleCount()
); |
716 desc.fOrigin = resolve_origin(wrapDesc.fOrigin, true); | 709 desc.fOrigin = resolve_origin(wrapDesc.fOrigin, true); |
(...skipping 41 matching lines...) Loading... |
758 // assuming the old behaviour, which is that backend textures are always | 751 // assuming the old behaviour, which is that backend textures are always |
759 // BottomLeft, even for non-RT's. Once Chrome is fixed, change this to: | 752 // BottomLeft, even for non-RT's. Once Chrome is fixed, change this to: |
760 // glTexDesc.fOrigin = resolve_origin(desc.fOrigin, renderTarget); | 753 // glTexDesc.fOrigin = resolve_origin(desc.fOrigin, renderTarget); |
761 if (kDefault_GrSurfaceOrigin == desc.fOrigin) { | 754 if (kDefault_GrSurfaceOrigin == desc.fOrigin) { |
762 surfDesc.fOrigin = kBottomLeft_GrSurfaceOrigin; | 755 surfDesc.fOrigin = kBottomLeft_GrSurfaceOrigin; |
763 } else { | 756 } else { |
764 surfDesc.fOrigin = desc.fOrigin; | 757 surfDesc.fOrigin = desc.fOrigin; |
765 } | 758 } |
766 | 759 |
767 GrGLRenderTarget::IDDesc rtIDDesc; | 760 GrGLRenderTarget::IDDesc rtIDDesc; |
768 if (!this->createRenderTargetObjects(surfDesc, GrGpuResource::kUncached_Life
Cycle, | 761 if (!this->createRenderTargetObjects(surfDesc, texInfo, &rtIDDesc)) { |
769 texInfo, &rtIDDesc)) { | |
770 return nullptr; | 762 return nullptr; |
771 } | 763 } |
772 return GrGLRenderTarget::CreateWrapped(this, surfDesc, rtIDDesc, 0); | 764 return GrGLRenderTarget::CreateWrapped(this, surfDesc, rtIDDesc, 0); |
773 } | 765 } |
774 | 766 |
775 //////////////////////////////////////////////////////////////////////////////// | 767 //////////////////////////////////////////////////////////////////////////////// |
776 | 768 |
777 bool GrGLGpu::onGetWritePixelsInfo(GrSurface* dstSurface, int width, int height, | 769 bool GrGLGpu::onGetWritePixelsInfo(GrSurface* dstSurface, int width, int height, |
778 GrPixelConfig srcConfig, | 770 GrPixelConfig srcConfig, |
779 DrawPreference* drawPreference, | 771 DrawPreference* drawPreference, |
(...skipping 701 matching lines...) Loading... |
1481 width, height)); | 1473 width, height)); |
1482 break; | 1474 break; |
1483 case GrGLCaps::kNone_MSFBOType: | 1475 case GrGLCaps::kNone_MSFBOType: |
1484 SkFAIL("Shouldn't be here if we don't support multisampled renderbuf
fers."); | 1476 SkFAIL("Shouldn't be here if we don't support multisampled renderbuf
fers."); |
1485 break; | 1477 break; |
1486 } | 1478 } |
1487 return (GR_GL_NO_ERROR == CHECK_ALLOC_ERROR(ctx.interface())); | 1479 return (GR_GL_NO_ERROR == CHECK_ALLOC_ERROR(ctx.interface())); |
1488 } | 1480 } |
1489 | 1481 |
1490 bool GrGLGpu::createRenderTargetObjects(const GrSurfaceDesc& desc, | 1482 bool GrGLGpu::createRenderTargetObjects(const GrSurfaceDesc& desc, |
1491 GrGpuResource::LifeCycle lifeCycle, | |
1492 const GrGLTextureInfo& texInfo, | 1483 const GrGLTextureInfo& texInfo, |
1493 GrGLRenderTarget::IDDesc* idDesc) { | 1484 GrGLRenderTarget::IDDesc* idDesc) { |
1494 idDesc->fMSColorRenderbufferID = 0; | 1485 idDesc->fMSColorRenderbufferID = 0; |
1495 idDesc->fRTFBOID = 0; | 1486 idDesc->fRTFBOID = 0; |
| 1487 idDesc->fRTFBOLifeCycle = GrBackendObjectLifeCycle::kInternal; |
1496 idDesc->fTexFBOID = 0; | 1488 idDesc->fTexFBOID = 0; |
1497 idDesc->fLifeCycle = lifeCycle; | |
1498 idDesc->fSampleConfig = (GrGLCaps::kMixedSamples_MSFBOType == this->glCaps()
.msFBOType() && | 1489 idDesc->fSampleConfig = (GrGLCaps::kMixedSamples_MSFBOType == this->glCaps()
.msFBOType() && |
1499 desc.fSampleCnt > 0) ? GrRenderTarget::kStencil_Samp
leConfig : | 1490 desc.fSampleCnt > 0) ? GrRenderTarget::kStencil_Samp
leConfig : |
1500 GrRenderTarget::kUnified_Samp
leConfig; | 1491 GrRenderTarget::kUnified_Samp
leConfig; |
1501 | 1492 |
1502 GrGLenum status; | 1493 GrGLenum status; |
1503 | 1494 |
1504 GrGLenum colorRenderbufferFormat = 0; // suppress warning | 1495 GrGLenum colorRenderbufferFormat = 0; // suppress warning |
1505 | 1496 |
1506 if (desc.fSampleCnt > 0 && GrGLCaps::kNone_MSFBOType == this->glCaps().msFBO
Type()) { | 1497 if (desc.fSampleCnt > 0 && GrGLCaps::kNone_MSFBOType == this->glCaps().msFBO
Type()) { |
1507 goto FAILED; | 1498 goto FAILED; |
(...skipping 91 matching lines...) Loading... |
1599 // SkDEBUGFAIL("null texture"); | 1590 // SkDEBUGFAIL("null texture"); |
1600 return nullptr; | 1591 return nullptr; |
1601 } | 1592 } |
1602 | 1593 |
1603 #if 0 && defined(SK_DEBUG) | 1594 #if 0 && defined(SK_DEBUG) |
1604 static size_t as_size_t(int x) { | 1595 static size_t as_size_t(int x) { |
1605 return x; | 1596 return x; |
1606 } | 1597 } |
1607 #endif | 1598 #endif |
1608 | 1599 |
1609 static GrGLTexture::IDDesc generate_gl_texture(const GrGLInterface* interface, | 1600 static GrGLTexture::IDDesc generate_gl_texture(const GrGLInterface* interface) { |
1610 GrGpuResource::LifeCycle lifeCycl
e) { | |
1611 GrGLTexture::IDDesc idDesc; | 1601 GrGLTexture::IDDesc idDesc; |
1612 idDesc.fInfo.fID = 0; | 1602 idDesc.fInfo.fID = 0; |
1613 GR_GL_CALL(interface, GenTextures(1, &idDesc.fInfo.fID)); | 1603 GR_GL_CALL(interface, GenTextures(1, &idDesc.fInfo.fID)); |
1614 idDesc.fLifeCycle = lifeCycle; | 1604 idDesc.fLifeCycle = GrBackendObjectLifeCycle::kInternal; |
1615 // When we create the texture, we only | 1605 // When we create the texture, we only |
1616 // create GL_TEXTURE_2D at the moment. | 1606 // create GL_TEXTURE_2D at the moment. |
1617 // External clients can do something different. | 1607 // External clients can do something different. |
1618 idDesc.fInfo.fTarget = GR_GL_TEXTURE_2D; | 1608 idDesc.fInfo.fTarget = GR_GL_TEXTURE_2D; |
1619 return idDesc; | 1609 return idDesc; |
1620 } | 1610 } |
1621 | 1611 |
1622 static void set_initial_texture_params(const GrGLInterface* interface, | 1612 static void set_initial_texture_params(const GrGLInterface* interface, |
1623 const GrGLTextureInfo& info, | 1613 const GrGLTextureInfo& info, |
1624 GrGLTexture::TexParams* initialTexParams)
{ | 1614 GrGLTexture::TexParams* initialTexParams)
{ |
(...skipping 14 matching lines...) Loading... |
1639 initialTexParams->fMinFilter)); | 1629 initialTexParams->fMinFilter)); |
1640 GR_GL_CALL(interface, TexParameteri(info.fTarget, | 1630 GR_GL_CALL(interface, TexParameteri(info.fTarget, |
1641 GR_GL_TEXTURE_WRAP_S, | 1631 GR_GL_TEXTURE_WRAP_S, |
1642 initialTexParams->fWrapS)); | 1632 initialTexParams->fWrapS)); |
1643 GR_GL_CALL(interface, TexParameteri(info.fTarget, | 1633 GR_GL_CALL(interface, TexParameteri(info.fTarget, |
1644 GR_GL_TEXTURE_WRAP_T, | 1634 GR_GL_TEXTURE_WRAP_T, |
1645 initialTexParams->fWrapT)); | 1635 initialTexParams->fWrapT)); |
1646 } | 1636 } |
1647 | 1637 |
1648 GrTexture* GrGLGpu::onCreateTexture(const GrSurfaceDesc& desc, | 1638 GrTexture* GrGLGpu::onCreateTexture(const GrSurfaceDesc& desc, |
1649 GrGpuResource::LifeCycle lifeCycle, | 1639 SkBudgeted budgeted, |
1650 const SkTArray<GrMipLevel>& texels) { | 1640 const SkTArray<GrMipLevel>& texels) { |
1651 // We fail if the MSAA was requested and is not available. | 1641 // We fail if the MSAA was requested and is not available. |
1652 if (GrGLCaps::kNone_MSFBOType == this->glCaps().msFBOType() && desc.fSampleC
nt) { | 1642 if (GrGLCaps::kNone_MSFBOType == this->glCaps().msFBOType() && desc.fSampleC
nt) { |
1653 //SkDebugf("MSAA RT requested but not supported on this platform."); | 1643 //SkDebugf("MSAA RT requested but not supported on this platform."); |
1654 return return_null_texture(); | 1644 return return_null_texture(); |
1655 } | 1645 } |
1656 | 1646 |
1657 bool renderTarget = SkToBool(desc.fFlags & kRenderTarget_GrSurfaceFlag); | 1647 bool renderTarget = SkToBool(desc.fFlags & kRenderTarget_GrSurfaceFlag); |
1658 | 1648 |
1659 GrGLTexture::IDDesc idDesc; | 1649 GrGLTexture::IDDesc idDesc; |
1660 idDesc.fLifeCycle = lifeCycle; | 1650 idDesc.fLifeCycle = GrBackendObjectLifeCycle::kInternal; |
1661 GrGLTexture::TexParams initialTexParams; | 1651 GrGLTexture::TexParams initialTexParams; |
1662 if (!this->createTextureImpl(desc, &idDesc.fInfo, renderTarget, &initialTexP
arams, texels)) { | 1652 if (!this->createTextureImpl(desc, &idDesc.fInfo, renderTarget, &initialTexP
arams, texels)) { |
1663 return return_null_texture(); | 1653 return return_null_texture(); |
1664 } | 1654 } |
1665 | 1655 |
1666 GrGLTexture* tex; | 1656 GrGLTexture* tex; |
1667 if (renderTarget) { | 1657 if (renderTarget) { |
1668 // unbind the texture from the texture unit before binding it to the fra
me buffer | 1658 // unbind the texture from the texture unit before binding it to the fra
me buffer |
1669 GL_CALL(BindTexture(idDesc.fInfo.fTarget, 0)); | 1659 GL_CALL(BindTexture(idDesc.fInfo.fTarget, 0)); |
1670 GrGLRenderTarget::IDDesc rtIDDesc; | 1660 GrGLRenderTarget::IDDesc rtIDDesc; |
1671 | 1661 |
1672 if (!this->createRenderTargetObjects(desc, lifeCycle, idDesc.fInfo, &rtI
DDesc)) { | 1662 if (!this->createRenderTargetObjects(desc, idDesc.fInfo, &rtIDDesc)) { |
1673 GL_CALL(DeleteTextures(1, &idDesc.fInfo.fID)); | 1663 GL_CALL(DeleteTextures(1, &idDesc.fInfo.fID)); |
1674 return return_null_texture(); | 1664 return return_null_texture(); |
1675 } | 1665 } |
1676 tex = new GrGLTextureRenderTarget(this, desc, idDesc, rtIDDesc); | 1666 tex = new GrGLTextureRenderTarget(this, budgeted, desc, idDesc, rtIDDesc
); |
1677 } else { | 1667 } else { |
1678 bool wasMipMapDataProvided = false; | 1668 bool wasMipMapDataProvided = false; |
1679 if (texels.count() > 1) { | 1669 if (texels.count() > 1) { |
1680 wasMipMapDataProvided = true; | 1670 wasMipMapDataProvided = true; |
1681 } | 1671 } |
1682 tex = new GrGLTexture(this, desc, idDesc, wasMipMapDataProvided); | 1672 tex = new GrGLTexture(this, budgeted, desc, idDesc, wasMipMapDataProvide
d); |
1683 } | 1673 } |
1684 tex->setCachedTexParams(initialTexParams, this->getResetTimestamp()); | 1674 tex->setCachedTexParams(initialTexParams, this->getResetTimestamp()); |
1685 #ifdef TRACE_TEXTURE_CREATION | 1675 #ifdef TRACE_TEXTURE_CREATION |
1686 SkDebugf("--- new texture [%d] size=(%d %d) config=%d\n", | 1676 SkDebugf("--- new texture [%d] size=(%d %d) config=%d\n", |
1687 glTexDesc.fInfo.fID, desc.fWidth, desc.fHeight, desc.fConfig); | 1677 glTexDesc.fInfo.fID, desc.fWidth, desc.fHeight, desc.fConfig); |
1688 #endif | 1678 #endif |
1689 return tex; | 1679 return tex; |
1690 } | 1680 } |
1691 | 1681 |
1692 GrTexture* GrGLGpu::onCreateCompressedTexture(const GrSurfaceDesc& desc, | 1682 GrTexture* GrGLGpu::onCreateCompressedTexture(const GrSurfaceDesc& desc, |
1693 GrGpuResource::LifeCycle lifeCycle
, | 1683 SkBudgeted budgeted, |
1694 const SkTArray<GrMipLevel>& texels
) { | 1684 const SkTArray<GrMipLevel>& texels
) { |
1695 // Make sure that we're not flipping Y. | 1685 // Make sure that we're not flipping Y. |
1696 if (kBottomLeft_GrSurfaceOrigin == desc.fOrigin) { | 1686 if (kBottomLeft_GrSurfaceOrigin == desc.fOrigin) { |
1697 return return_null_texture(); | 1687 return return_null_texture(); |
1698 } | 1688 } |
1699 | 1689 |
1700 GrGLTexture::IDDesc idDesc = generate_gl_texture(this->glInterface(), lifeCy
cle); | 1690 GrGLTexture::IDDesc idDesc = generate_gl_texture(this->glInterface()); |
1701 if (!idDesc.fInfo.fID) { | 1691 if (!idDesc.fInfo.fID) { |
1702 return return_null_texture(); | 1692 return return_null_texture(); |
1703 } | 1693 } |
1704 | 1694 |
1705 this->setScratchTextureUnit(); | 1695 this->setScratchTextureUnit(); |
1706 GL_CALL(BindTexture(idDesc.fInfo.fTarget, idDesc.fInfo.fID)); | 1696 GL_CALL(BindTexture(idDesc.fInfo.fTarget, idDesc.fInfo.fID)); |
1707 | 1697 |
1708 GrGLTexture::TexParams initialTexParams; | 1698 GrGLTexture::TexParams initialTexParams; |
1709 set_initial_texture_params(this->glInterface(), idDesc.fInfo, &initialTexPar
ams); | 1699 set_initial_texture_params(this->glInterface(), idDesc.fInfo, &initialTexPar
ams); |
1710 | 1700 |
1711 if (!this->uploadCompressedTexData(desc, idDesc.fInfo.fTarget, texels)) { | 1701 if (!this->uploadCompressedTexData(desc, idDesc.fInfo.fTarget, texels)) { |
1712 GL_CALL(DeleteTextures(1, &idDesc.fInfo.fID)); | 1702 GL_CALL(DeleteTextures(1, &idDesc.fInfo.fID)); |
1713 return return_null_texture(); | 1703 return return_null_texture(); |
1714 } | 1704 } |
1715 | 1705 |
1716 GrGLTexture* tex; | 1706 GrGLTexture* tex; |
1717 tex = new GrGLTexture(this, desc, idDesc); | 1707 tex = new GrGLTexture(this, budgeted, desc, idDesc); |
1718 tex->setCachedTexParams(initialTexParams, this->getResetTimestamp()); | 1708 tex->setCachedTexParams(initialTexParams, this->getResetTimestamp()); |
1719 #ifdef TRACE_TEXTURE_CREATION | 1709 #ifdef TRACE_TEXTURE_CREATION |
1720 SkDebugf("--- new compressed texture [%d] size=(%d %d) config=%d\n", | 1710 SkDebugf("--- new compressed texture [%d] size=(%d %d) config=%d\n", |
1721 glTexDesc.fInfo.fID, desc.fWidth, desc.fHeight, desc.fConfig); | 1711 glTexDesc.fInfo.fID, desc.fWidth, desc.fHeight, desc.fConfig); |
1722 #endif | 1712 #endif |
1723 return tex; | 1713 return tex; |
1724 } | 1714 } |
1725 | 1715 |
1726 namespace { | 1716 namespace { |
1727 | 1717 |
(...skipping 2589 matching lines...) Loading... |
4317 if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() || | 4307 if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() || |
4318 GR_GL_TEXTURE_RECTANGLE == glTexture->target()) { | 4308 GR_GL_TEXTURE_RECTANGLE == glTexture->target()) { |
4319 copyParams->fFilter = GrTextureParams::kNone_FilterMode; | 4309 copyParams->fFilter = GrTextureParams::kNone_FilterMode; |
4320 copyParams->fWidth = texture->width(); | 4310 copyParams->fWidth = texture->width(); |
4321 copyParams->fHeight = texture->height(); | 4311 copyParams->fHeight = texture->height(); |
4322 return true; | 4312 return true; |
4323 } | 4313 } |
4324 } | 4314 } |
4325 return false; | 4315 return false; |
4326 } | 4316 } |
OLD | NEW |