Lines Matching refs:caches

54 static inline void bindTexture(Caches* caches, Texture* texture, GLenum wrapS, GLenum wrapT) {
55 caches->textureState().bindTexture(texture->id);
115 bool tryStoreGradient(Caches& caches, const SkShader& shader, const Matrix4 modelViewMatrix,
164 outData->gradientTexture = caches.gradientCache.get(
179 void applyGradient(Caches& caches, const SkiaShaderData::GradientShaderData& data) {
181 caches.textureState().activateTexture(data.gradientSampler);
182 bindTexture(&caches, data.gradientTexture, data.wrapST, data.wrapST);
183 glUniform1i(caches.program().getUniform("gradientSampler"), data.gradientSampler);
185 bindUniformColor(caches.program().getUniform("startColor"), data.startColor);
186 bindUniformColor(caches.program().getUniform("endColor"), data.endColor);
192 caches.dither.setupProgram(caches.program(), &ditherSampler);
193 glUniformMatrix4fv(caches.program().getUniform("screenSpace"), 1,
197 bool tryStoreBitmap(Caches& caches, const SkShader& shader, const Matrix4& modelViewMatrix,
212 outData->bitmapTexture = caches.textureCache.getAndBypassAtlas(&bitmap);
221 if (!caches.extensions().hasNPot()
243 void applyBitmap(Caches& caches, const SkiaShaderData::BitmapShaderData& data) {
244 caches.textureState().activateTexture(data.bitmapSampler);
245 bindTexture(&caches, data.bitmapTexture, data.wrapS, data.wrapT);
248 glUniform1i(caches.program().getUniform("bitmapSampler"), data.bitmapSampler);
249 glUniformMatrix4fv(caches.program().getUniform("textureTransform"), 1, GL_FALSE,
251 glUniform2fv(caches.program().getUniform("textureDimension"), 1, &data.textureDimension[0]);
276 void storeCompose(Caches& caches, const SkShader& bitmapShader, const SkShader& gradientShader,
279 LOG_ALWAYS_FATAL_IF(!tryStoreBitmap(caches, bitmapShader, modelViewMatrix,
282 LOG_ALWAYS_FATAL_IF(!tryStoreGradient(caches, gradientShader, modelViewMatrix,
287 bool tryStoreCompose(Caches& caches, const SkShader& shader, const Matrix4& modelViewMatrix,
305 storeCompose(caches, *rec.fShaderA, *rec.fShaderB,
309 storeCompose(caches, *rec.fShaderB, *rec.fShaderA,
319 bool tryStoreLayer(Caches& caches, const SkShader& shader, const Matrix4& modelViewMatrix,
342 void applyLayer(Caches& caches, const SkiaShaderData::LayerShaderData& data) {
343 caches.textureState().activateTexture(data.bitmapSampler);
349 glUniform1i(caches.program().getUniform("bitmapSampler"), data.bitmapSampler);
350 glUniformMatrix4fv(caches.program().getUniform("textureTransform"), 1,
352 glUniform2fv(caches.program().getUniform("textureDimension"), 1, &data.textureDimension[0]);
355 void SkiaShader::store(Caches& caches, const SkShader& shader, const Matrix4& modelViewMatrix,
358 if (tryStoreGradient(caches, shader, modelViewMatrix,
364 if (tryStoreBitmap(caches, shader, modelViewMatrix,
370 if (tryStoreCompose(caches, shader, modelViewMatrix,
376 if (tryStoreLayer(caches, shader, modelViewMatrix,
386 void SkiaShader::apply(Caches& caches, const SkiaShaderData& data) {
390 applyGradient(caches, data.gradientData);
393 applyBitmap(caches, data.bitmapData);
397 applyLayer(caches, data.layerData);