Optimize several functions for the Program perf test.

This gives the same or slightly better performance in the ProgramDraw
perf test. Also only set the Program object as dirty when there are
dirty bits set in the Program itself.

Bug: angleproject:2877
Change-Id: I07b428b40d3e3c24e0a42c970524756b6dc3a30e
Reviewed-on: https://chromium-review.googlesource.com/c/1271475
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/Program.cpp b/src/libANGLE/Program.cpp
index c0fd27c..dceb002 100644
--- a/src/libANGLE/Program.cpp
+++ b/src/libANGLE/Program.cpp
@@ -955,11 +955,6 @@
     ASSERT(mLinkResolved);
     return mState.mLabel;
 }
-rx::ProgramImpl *Program::getImplementation() const
-{
-    ASSERT(mLinkResolved);
-    return mProgram;
-}
 
 void Program::attachShader(Shader *shader)
 {
@@ -1567,21 +1562,10 @@
     return mState.mSeparable;
 }
 
-void Program::release(const Context *context)
+void Program::deleteSelf(const Context *context)
 {
-    ASSERT(mLinkResolved);
-    mRefCount--;
-
-    if (mRefCount == 0 && mDeleteStatus)
-    {
-        mResourceManager->deleteProgram(context, mHandle);
-    }
-}
-
-void Program::addRef()
-{
-    ASSERT(mLinkResolved);
-    mRefCount++;
+    ASSERT(mRefCount == 0 && mDeleteStatus);
+    mResourceManager->deleteProgram(context, mHandle);
 }
 
 unsigned int Program::getRefCount() const
@@ -2375,18 +2359,6 @@
     return mValidated;
 }
 
-GLuint Program::getActiveAtomicCounterBufferCount() const
-{
-    ASSERT(mLinkResolved);
-    return static_cast<GLuint>(mState.mAtomicCounterBuffers.size());
-}
-
-GLuint Program::getActiveShaderStorageBlockCount() const
-{
-    ASSERT(mLinkResolved);
-    return static_cast<GLuint>(mState.mShaderStorageBlocks.size());
-}
-
 void Program::getActiveUniformBlockName(const GLuint blockIndex,
                                         GLsizei bufSize,
                                         GLsizei *length,