diff options
author | Romain Guy <romainguy@google.com> | 2010-07-21 21:33:20 -0700 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2010-07-21 21:33:20 -0700 |
commit | 694b519ac647fe998fd396fe0784cc8e179aadc4 (patch) | |
tree | 80a5e423f90aba3ab74645ac7f3b2cbfd838c757 /libs/hwui/Program.cpp | |
parent | 0119ba5bd3335fe026927eeb65de535a7bd8c838 (diff) |
Add text rendering.
Change-Id: Ibe5a9fa844d531b31b55e43de403a98d49f659b9
Diffstat (limited to 'libs/hwui/Program.cpp')
-rw-r--r-- | libs/hwui/Program.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libs/hwui/Program.cpp b/libs/hwui/Program.cpp index 841b6c842f9a..6e608084f5bb 100644 --- a/libs/hwui/Program.cpp +++ b/libs/hwui/Program.cpp @@ -33,6 +33,8 @@ namespace uirenderer { #include "shaders/drawTexture.vert" #include "shaders/drawTexture.frag" +#include "shaders/drawText.frag" + #include "shaders/drawLinearGradient.vert" #include "shaders/drawLinearGradient.frag" @@ -169,6 +171,12 @@ DrawTextureProgram::DrawTextureProgram(): sampler = addUniform("sampler"); } +DrawTextureProgram::DrawTextureProgram(const char* vertex, const char* fragment): + DrawColorProgram(vertex, fragment) { + texCoords = addAttrib("texCoords"); + sampler = addUniform("sampler"); +} + void DrawTextureProgram::use() { DrawColorProgram::use(); glActiveTexture(GL_TEXTURE0); @@ -182,6 +190,14 @@ void DrawTextureProgram::remove() { } /////////////////////////////////////////////////////////////////////////////// +// Draw text +/////////////////////////////////////////////////////////////////////////////// + +DrawTextProgram::DrawTextProgram(): + DrawTextureProgram(gDrawTextureVertexShader, gDrawTextFragmentShader) { +} + +/////////////////////////////////////////////////////////////////////////////// // Draw linear gradient /////////////////////////////////////////////////////////////////////////////// |