Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Unified Diff: src/gpu/effects/GrTextureStripAtlas.h

Issue 655913003: Use texture strip atlas for color table filter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix include order Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/effects/GrTextureStripAtlas.h
diff --git a/src/gpu/effects/GrTextureStripAtlas.h b/src/gpu/effects/GrTextureStripAtlas.h
index 58539fc0acb8730deaf068971a129f86c5a52ca6..80b33bbac4bd7504246d481bea440b1b512aab30 100644
--- a/src/gpu/effects/GrTextureStripAtlas.h
+++ b/src/gpu/effects/GrTextureStripAtlas.h
@@ -61,11 +61,11 @@ public:
* texture2D(sampler, vec2(x, yOffset + y * scaleFactor))
*
* Where yOffset, returned by getYOffset(), is the offset to the start of the row within the
- * atlas and scaleFactor, returned by getVerticalScaleFactor(), is the y-scale of the row,
- * relative to the height of the overall atlas texture.
+ * atlas and scaleFactor, returned by getNormalizedTexelHeight, is the normalized height of
+ * one texel row.
*/
SkScalar getYOffset(int row) const { return SkIntToScalar(row) / fNumRows; }
- SkScalar getVerticalScaleFactor() const { return SkIntToScalar(fDesc.fRowHeight) / fDesc.fHeight; }
+ SkScalar getNormalizedTexelHeight() const { return fNormalizedYHeight; }
GrContext* getContext() const { return fDesc.fContext; }
GrTexture* getTexture() const { return fTexture; }
@@ -168,6 +168,8 @@ private:
const uint16_t fNumRows;
GrTexture* fTexture;
+ SkScalar fNormalizedYHeight;
+
// Array of AtlasRows which store the state of all our rows. Stored in a contiguous array, in
// order that they appear in our texture, this means we can subtract this pointer from a row
// pointer to get its index in the texture, and can save storing a row number in AtlasRow.

Powered by Google App Engine
This is Rietveld 408576698