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

Unified Diff: cc/resources/resource_provider.h

Issue 375303002: cc: Refactor ResourceProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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: cc/resources/resource_provider.h
diff --git a/cc/resources/resource_provider.h b/cc/resources/resource_provider.h
index 5a828b1197442f5a7f85698606332e5da6142311..8e6189429b230aa306acc51ea3da9651067e2e0b 100644
--- a/cc/resources/resource_provider.h
+++ b/cc/resources/resource_provider.h
@@ -22,6 +22,7 @@
#include "cc/output/output_surface.h"
#include "cc/resources/release_callback.h"
#include "cc/resources/resource_format.h"
+#include "cc/resources/resource_helper.h"
#include "cc/resources/return_callback.h"
#include "cc/resources/shared_bitmap.h"
#include "cc/resources/single_release_callback.h"
@@ -153,18 +154,6 @@ class CC_EXPORT ResourceProvider {
void ReleaseCachedData();
base::TimeTicks EstimatedUploadCompletionTime(size_t uploads_per_tick);
- // Flush all context operations, kicking uploads and ensuring ordering with
- // respect to other contexts.
- void Flush();
-
- // Finish all context operations, causing any pending callbacks to be
- // scheduled.
- void Finish();
-
- // Only flush the command buffer if supported.
- // Returns true if the shallow flush occurred, false otherwise.
- bool ShallowFlushIfSupported();
-
// Creates accounting for a child. Returns a child ID.
int CreateChild(const ReturnCallback& return_callback);
@@ -306,20 +295,6 @@ class CC_EXPORT ResourceProvider {
DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockSoftware);
};
- // The following class is needed to modify GL resources using GPU
- // raster. The user must ensure that they only use GPU raster on
- // GL resources while an instance of this class is alive.
- class CC_EXPORT ScopedGpuRaster {
- public:
- ScopedGpuRaster(ResourceProvider* resource_provider);
- ~ScopedGpuRaster();
-
- private:
- ResourceProvider* resource_provider_;
-
- DISALLOW_COPY_AND_ASSIGN(ScopedGpuRaster);
- };
-
class Fence : public base::RefCounted<Fence> {
public:
Fence() {}
@@ -386,7 +361,7 @@ class CC_EXPORT ResourceProvider {
// Copy pixels from source to destination.
void CopyResource(ResourceId source_id, ResourceId dest_id);
- static GLint GetActiveTextureUnit(gpu::gles2::GLES2Interface* gl);
+ ResourceHelper* GetResourceHelper() { return resource_helper_.get(); }
private:
class GpuRasterBuffer;
@@ -637,13 +612,6 @@ class CC_EXPORT ResourceProvider {
GLenum unit,
GLenum filter);
- // Returns NULL if the output_surface_ does not have a ContextProvider.
- gpu::gles2::GLES2Interface* ContextGL() const;
danakj 2014/07/09 16:01:33 These are private methods used internally in Resou
sohanjg 2014/07/10 15:11:06 Done. Had to pull them to public though, because
- class GrContext* GrContext() const;
-
- void BeginGpuRaster();
- void EndGpuRaster();
-
OutputSurface* output_surface_;
SharedBitmapManager* shared_bitmap_manager_;
bool lost_output_surface_;
@@ -674,6 +642,8 @@ class CC_EXPORT ResourceProvider {
bool use_distance_field_text_;
+ scoped_ptr<ResourceHelper> resource_helper_;
+
DISALLOW_COPY_AND_ASSIGN(ResourceProvider);
};

Powered by Google App Engine
This is Rietveld 408576698