From 8195f674278e8d785bf57489847b1d05d3c2f7d5 Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Wed, 12 Jan 2011 18:14:28 +0000 Subject: [PATCH] rename DrawState to DrState -- MS decided to #define DrawState, complicating our (compiler) lives :( git-svn-id: http://skia.googlecode.com/svn/trunk@689 2bbb7eff-a529-9590-31e7-b0007b416f81 --- gpu/include/GrDrawTarget.h | 16 ++++++++-------- gpu/src/GrGpu.cpp | 2 +- gpu/src/GrGpuGL.h | 4 ++-- gpu/src/GrInOrderDrawBuffer.cpp | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/gpu/include/GrDrawTarget.h b/gpu/include/GrDrawTarget.h index fee13a6..2823da7 100644 --- a/gpu/include/GrDrawTarget.h +++ b/gpu/include/GrDrawTarget.h @@ -131,7 +131,7 @@ protected: kMatrixModeCount }; - struct DrawState { + struct DrState { uint32_t fFlagBits; BlendCoeff fSrcBlend; BlendCoeff fDstBlend; @@ -143,10 +143,10 @@ protected: StencilPass fStencilPass; bool fReverseFill; GrMatrix fMatrixModeCache[kMatrixModeCount]; - bool operator ==(const DrawState& s) const { - return 0 == memcmp(this, &s, sizeof(DrawState)); + bool operator ==(const DrState& s) const { + return 0 == memcmp(this, &s, sizeof(DrState)); } - bool operator !=(const DrawState& s) const { return !(*this == s); } + bool operator !=(const DrState& s) const { return !(*this == s); } }; public: @@ -346,7 +346,7 @@ public: */ struct SavedDrawState { private: - DrawState fState; + DrState fState; friend class GrDrawTarget; }; @@ -664,9 +664,9 @@ protected: // Helpers for GrDrawTarget subclasses that won't have private access to // SavedDrawState but need to peek at the state values. - static DrawState& accessSavedDrawState(SavedDrawState& sds) + static DrState& accessSavedDrawState(SavedDrawState& sds) { return sds.fState; } - static const DrawState& accessSavedDrawState(const SavedDrawState& sds) + static const DrState& accessSavedDrawState(const SavedDrawState& sds) { return sds.fState; } // implemented by subclass @@ -706,7 +706,7 @@ protected: GrClip fClip; - DrawState fCurrDrawState; + DrState fCurrDrawState; // set texture or modelview matrix void loadMatrix(const GrMatrix&, MatrixMode); diff --git a/gpu/src/GrGpu.cpp b/gpu/src/GrGpu.cpp index c6340bd..f9ee217 100644 --- a/gpu/src/GrGpu.cpp +++ b/gpu/src/GrGpu.cpp @@ -112,7 +112,7 @@ bool GrGpu::canDisableBlend() const { static const int MAX_QUADS = 512; // max possible: (1 << 14) - 1; -GR_STATIC_ASSERT(4 * MAX_QUADS <= UINT16_MAX); +GR_STATIC_ASSERT(4 * MAX_QUADS <= 65535); static inline void fillIndices(uint16_t* indices, int quadCount) { for (int i = 0; i < quadCount; ++i) { diff --git a/gpu/src/GrGpuGL.h b/gpu/src/GrGpuGL.h index dc766be..728a5d3 100644 --- a/gpu/src/GrGpuGL.h +++ b/gpu/src/GrGpuGL.h @@ -70,8 +70,8 @@ protected: const GrIndexBuffer* fIndexBuffer; } fHWGeometryState; - DrawState fHWDrawState; - bool fHWStencilClip; + DrState fHWDrawState; + bool fHWStencilClip; virtual void drawIndexedHelper(PrimitiveType type, uint32_t startVertex, diff --git a/gpu/src/GrInOrderDrawBuffer.cpp b/gpu/src/GrInOrderDrawBuffer.cpp index 3f25f2f..952ba83 100644 --- a/gpu/src/GrInOrderDrawBuffer.cpp +++ b/gpu/src/GrInOrderDrawBuffer.cpp @@ -316,7 +316,7 @@ bool GrInOrderDrawBuffer::grabState() { if (fStates.empty()) { newState = true; } else { - const DrawState& old = accessSavedDrawState(fStates.back()); + const DrState& old = accessSavedDrawState(fStates.back()); newState = old != fCurrDrawState; } if (newState) { -- 2.7.4