aboutsummaryrefslogtreecommitdiffhomepage
path: root/gpu/src/GrGpuGL.h
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-02-17 16:43:10 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-02-17 16:43:10 +0000
commitc6cf72381b212eb21e61d5c5e14247b483a77753 (patch)
tree766c1b8279c387b424bb8ac5c60004610c74ab9e /gpu/src/GrGpuGL.h
parentdbbdad70511472d40ffb358750c53ae7891f3881 (diff)
Hide alloc size vs content size below API
Remove old gl shaders class Move texture matrix to sampler class git-svn-id: http://skia.googlecode.com/svn/trunk@808 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu/src/GrGpuGL.h')
-rw-r--r--gpu/src/GrGpuGL.h40
1 files changed, 29 insertions, 11 deletions
diff --git a/gpu/src/GrGpuGL.h b/gpu/src/GrGpuGL.h
index d89b8d54d7..a2ccc12c56 100644
--- a/gpu/src/GrGpuGL.h
+++ b/gpu/src/GrGpuGL.h
@@ -71,6 +71,26 @@ protected:
DrState fHWDrawState;
bool fHWStencilClip;
+ // As flush of GL state proceeds it updates fHDrawState
+ // to reflect the new state. Later parts of the state flush
+ // may perform cascaded changes but cannot refer to fHWDrawState.
+ // These code paths can refer to the dirty flags. Subclass should
+ // call resetDirtyFlags after its flush is complete
+ struct {
+ bool fRenderTargetChanged : 1;
+ bool fWriteMaskChanged : 1;
+ int fTextureChangedMask;
+ } fDirtyFlags;
+ GR_STATIC_ASSERT(8 * sizeof(int) >= kNumStages);
+
+ // clears the dirty flags
+ void resetDirtyFlags();
+
+ // last scissor / viewport scissor state seen by the GL.
+ BoundsState fHWBounds;
+
+ GrGLExts fExts;
+
// GrGpu overrides
virtual void drawIndexedHelper(PrimitiveType type,
uint32_t startVertex,
@@ -103,18 +123,16 @@ protected:
// line width
bool flushGLStateCommon(PrimitiveType type);
- // set when this class changes the rendertarget.
- // Subclass should notice at flush time, take appropriate action,
- // and set false.
- bool fRenderTargetChanged;
-
- // set by eraseColor or eraseStencil. Picked up in in flushStencil.
- bool fWriteMaskChanged;
-
- // last scissor / viewport scissor state seen by the GL.
- BoundsState fHWBounds;
+ // adjusts texture matrix to account for orientation, size, and npotness
+ static void AdjustTextureMatrix(const GrGLTexture* texture,
+ GrSamplerState::SampleMode mode,
+ GrMatrix* matrix);
- GrGLExts fExts;
+ // subclass may try to take advantage of identity tex matrices.
+ // This helper determines if matrix will be identity after all
+ // adjustments are applied.
+ static bool TextureMatrixIsIdentity(const GrGLTexture* texture,
+ const GrSamplerState& sampler);
private:
void resetContextHelper();