aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrProcessor.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-06-01 12:55:44 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-02 11:46:40 +0000
commit18166eeaf2d088d494c4273b88107544166046fd (patch)
treea5653250b48b2c3c432127ac2e40d57008a5f117 /src/gpu/GrProcessor.cpp
parentdec4c0b29843d5de7d06c3998d919b3e3abecdf2 (diff)
Omnibus: Push instantiation of GrTextures later (post TextureSampler)
Split into: https://skia-review.googlesource.com/c/10485/ (More GrSurfaceProxy-clean up) https://skia-review.googlesource.com/c/15819/ (Expand GrTextureProxy to handle highestFilterMode) https://skia-review.googlesource.com/c/16714/ (Switch ImageStorageAccess over to GrTextureProxies) https://skia-review.googlesource.com/c/16908/ (Convert DstTexture to DstProxy) Change-Id: I6cf3ba0f3bf0e1908d36749bc83571c066ddd568 Reviewed-on: https://skia-review.googlesource.com/10484 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrProcessor.cpp')
-rw-r--r--src/gpu/GrProcessor.cpp29
1 files changed, 7 insertions, 22 deletions
diff --git a/src/gpu/GrProcessor.cpp b/src/gpu/GrProcessor.cpp
index 0bce078784..51cfdfb73c 100644
--- a/src/gpu/GrProcessor.cpp
+++ b/src/gpu/GrProcessor.cpp
@@ -143,7 +143,7 @@ void GrResourceIOProcessor::addImageStorageAccess(GrResourceProvider* resourcePr
void GrResourceIOProcessor::addPendingIOs() const {
for (const auto& sampler : fTextureSamplers) {
- sampler->programTexture()->markPendingIO();
+ sampler->programProxy()->markPendingIO();
}
for (const auto& buffer : fBufferAccesses) {
buffer->programBuffer()->markPendingIO();
@@ -155,7 +155,7 @@ void GrResourceIOProcessor::addPendingIOs() const {
void GrResourceIOProcessor::removeRefs() const {
for (const auto& sampler : fTextureSamplers) {
- sampler->programTexture()->removeRef();
+ sampler->programProxy()->removeRef();
}
for (const auto& buffer : fBufferAccesses) {
buffer->programBuffer()->removeRef();
@@ -167,7 +167,7 @@ void GrResourceIOProcessor::removeRefs() const {
void GrResourceIOProcessor::pendingIOComplete() const {
for (const auto& sampler : fTextureSamplers) {
- sampler->programTexture()->pendingIOComplete();
+ sampler->programProxy()->pendingIOComplete();
}
for (const auto& buffer : fBufferAccesses) {
buffer->programBuffer()->pendingIOComplete();
@@ -242,16 +242,8 @@ void GrResourceIOProcessor::TextureSampler::reset(GrResourceProvider* resourcePr
const GrSamplerParams& params,
GrShaderFlags visibility) {
fParams = params;
-
- // For now, end the deferral at this time. Once all the TextureSamplers are swapped over
- // to taking a GrSurfaceProxy just use the IORefs on the proxy
- GrTexture* texture = proxy->instantiateTexture(resourceProvider);
- if (texture) {
- fTexture.set(SkRef(texture), kRead_GrIOType);
- SkASSERT(texture->texturePriv().highestFilterMode() == proxy->highestFilterMode());
- fParams.setFilterMode(SkTMin(params.filterMode(), proxy->highestFilterMode()));
- }
-
+ fProxyRef.setProxy(std::move(proxy), kRead_GrIOType);
+ fParams.setFilterMode(SkTMin(params.filterMode(), this->proxy()->highestFilterMode()));
fVisibility = visibility;
}
@@ -260,15 +252,8 @@ void GrResourceIOProcessor::TextureSampler::reset(GrResourceProvider* resourcePr
GrSamplerParams::FilterMode filterMode,
SkShader::TileMode tileXAndY,
GrShaderFlags visibility) {
- // For now, end the deferral at this time. Once all the TextureSamplers are swapped over
- // to taking a GrSurfaceProxy just use the IORefs on the proxy
- GrTexture* texture = proxy->instantiateTexture(resourceProvider);
- if (texture) {
- fTexture.set(SkRef(texture), kRead_GrIOType);
- SkASSERT(texture->texturePriv().highestFilterMode() == proxy->highestFilterMode());
- filterMode = SkTMin(filterMode, proxy->highestFilterMode());
- }
-
+ fProxyRef.setProxy(std::move(proxy), kRead_GrIOType);
+ filterMode = SkTMin(filterMode, this->proxy()->highestFilterMode());
fParams.reset(tileXAndY, filterMode);
fVisibility = visibility;
}