Index: cc/resources/resource_provider.cc |
diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc |
index 449e04be23750e28d015ef04a50014eee0977f00..bed47f4ac69607672d8082b602e5e91cea528dbf 100644 |
--- a/cc/resources/resource_provider.cc |
+++ b/cc/resources/resource_provider.cc |
@@ -207,48 +207,30 @@ class BufferIdAllocator : public IdAllocator { |
DISALLOW_COPY_AND_ASSIGN(BufferIdAllocator); |
}; |
-// Query object based fence implementation used to detect completion of copy |
-// texture operations. Fence has passed when query result is available. |
-class CopyTextureFence : public ResourceProvider::Fence { |
- public: |
- CopyTextureFence(gpu::gles2::GLES2Interface* gl, unsigned query_id) |
- : gl_(gl), query_id_(query_id) {} |
- |
- // Overridden from ResourceProvider::Fence: |
- void Set() override {} |
- bool HasPassed() override { |
- unsigned available = 1; |
- gl_->GetQueryObjectuivEXT( |
- query_id_, GL_QUERY_RESULT_AVAILABLE_EXT, &available); |
- if (!available) |
- return false; |
+} // namespace |
- ProcessResult(); |
- return true; |
+bool ResourceProvider::CopyTextureFence::HasPassed() { |
+ unsigned available = 1; |
+ gl_->GetQueryObjectuivEXT(query_id_, GL_QUERY_RESULT_AVAILABLE_EXT, |
+ &available); |
+ if (!available) |
+ return false; |
+ |
+ ProcessResult(); |
+ return true; |
} |
- void Wait() override { |
+ void ResourceProvider::CopyTextureFence::Wait() { |
// ProcessResult() will wait for result to become available. |
ProcessResult(); |
} |
- private: |
- ~CopyTextureFence() override {} |
- |
- void ProcessResult() { |
+ void ResourceProvider::CopyTextureFence::ProcessResult() { |
unsigned time_elapsed_us = 0; |
gl_->GetQueryObjectuivEXT(query_id_, GL_QUERY_RESULT_EXT, &time_elapsed_us); |
UMA_HISTOGRAM_CUSTOM_COUNTS("Renderer4.CopyTextureLatency", time_elapsed_us, |
0, 256000, 50); |
} |
- gpu::gles2::GLES2Interface* gl_; |
- unsigned query_id_; |
- |
- DISALLOW_COPY_AND_ASSIGN(CopyTextureFence); |
-}; |
- |
-} // namespace |
- |
ResourceProvider::Resource::~Resource() {} |
ResourceProvider::Resource::Resource(GLuint texture_id, |