Home | History | Annotate | Download | only in hwui

Lines Matching refs:Caches

19 #include "Caches.h"
59 static inline void bindTexture(Caches* caches, Texture* texture, GLenum wrapS, GLenum wrapT) {
60 caches->textureState().bindTexture(texture->target(), texture->id());
120 bool tryStoreGradient(Caches& caches, const SkShader& shader, const Matrix4 modelViewMatrix,
169 outData->gradientTexture = caches.gradientCache.get(
183 void applyGradient(Caches& caches, const SkiaShaderData::GradientShaderData& data,
186 caches.textureState().activateTexture(data.gradientSampler);
187 bindTexture(&caches, data.gradientTexture, data.wrapST, data.wrapST);
188 glUniform1i(caches.program().getUniform("gradientSampler"), data.gradientSampler);
190 bindUniformColor(caches.program().getUniform("startColor"), data.startColor);
191 bindUniformColor(caches.program().getUniform("endColor"), data.endColor);
194 glUniform2f(caches.program().getUniform("screenSize"), 1.0f / width, 1.0f / height);
195 glUniformMatrix4fv(caches.program().getUniform("screenSpace"), 1, GL_FALSE,
199 bool tryStoreBitmap(Caches& caches, const SkShader& shader, const Matrix4& modelViewMatrix,
210 outData->bitmapTexture = caches.textureCache.get(hwuiBitmap);
228 (!caches.extensions().hasNPot() && (!isPowerOfTwo(width) || !isPowerOfTwo(height)) &&
251 void applyBitmap(Caches& caches, const SkiaShaderData::BitmapShaderData& data) {
252 caches.textureState().activateTexture(data.bitmapSampler);
253 bindTexture(&caches, data.bitmapTexture, data.wrapS, data.wrapT);
256 glUniform1i(caches.program().getUniform("bitmapSampler"), data.bitmapSampler);
257 glUniformMatrix4fv(caches.program().getUniform("textureTransform"), 1, GL_FALSE,
259 glUniform2fv(caches.program().getUniform("textureDimension"), 1, &data.textureDimension[0]);
284 void storeCompose(Caches& caches, const SkShader& bitmapShader, const SkShader& gradientShader,
287 LOG_ALWAYS_FATAL_IF(!tryStoreBitmap(caches, bitmapShader, modelViewMatrix, textureUnit,
290 LOG_ALWAYS_FATAL_IF(!tryStoreGradient(caches, gradientShader, modelViewMatrix, textureUnit,
295 bool tryStoreCompose(Caches& caches, const SkShader& shader, const Matrix4& modelViewMatrix,
312 storeCompose(caches, *rec.fShaderA, *rec.fShaderB, transform, textureUnit, description,
316 storeCompose(caches, *rec.fShaderB, *rec.fShaderA, transform, textureUnit, description,
323 void SkiaShader::store(Caches& caches, const SkShader& shader, const Matrix4& modelViewMatrix,
326 if (tryStoreGradient(caches, shader, modelViewMatrix, textureUnit, description,
332 if (tryStoreBitmap(caches, shader, modelViewMatrix, textureUnit, description,
338 if (tryStoreCompose(caches, shader, modelViewMatrix, textureUnit, description, outData)) {
347 void SkiaShader::apply(Caches& caches, const SkiaShaderData& data, const GLsizei width,
352 applyGradient(caches, data.gradientData, width, height);
355 applyBitmap(caches, data.bitmapData);