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

Unified Diff: content/common/gpu/image_transport_surface_calayer_mac.h

Issue 454243002: Make GPU back-pressure work with remote CALayers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix flashes Created 6 years, 4 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: content/common/gpu/image_transport_surface_calayer_mac.h
diff --git a/content/common/gpu/image_transport_surface_calayer_mac.h b/content/common/gpu/image_transport_surface_calayer_mac.h
index e8e2af0d77b38871ac9e9b57ab21ddf2f0ae2746..85ee4181a3a33c82e46c6c9b4a825cdd5a36817c 100644
--- a/content/common/gpu/image_transport_surface_calayer_mac.h
+++ b/content/common/gpu/image_transport_surface_calayer_mac.h
@@ -11,12 +11,7 @@
#include "ui/gl/gl_bindings.h"
#include "ui/gl/scoped_cgl.h"
-@interface ImageTransportLayer : CAOpenGLLayer {
- base::ScopedTypeRef<CGLContextObj> shareContext_;
- GLuint texture_;
- gfx::Size pixelSize_;
-}
-@end
+@class ImageTransportLayer;
namespace content {
@@ -24,7 +19,7 @@ namespace content {
class CALayerStorageProvider
: public ImageTransportSurfaceFBO::StorageProvider {
public:
- CALayerStorageProvider();
+ CALayerStorageProvider(ImageTransportSurfaceFBO* transport_surface);
virtual ~CALayerStorageProvider();
// ImageTransportSurfaceFBO::StorageProvider implementation:
@@ -35,8 +30,31 @@ class CALayerStorageProvider
virtual void FreeColorBufferStorage() OVERRIDE;
virtual uint64 GetSurfaceHandle() const OVERRIDE;
virtual void WillSwapBuffers() OVERRIDE;
+ virtual void CanFreeSwappedBuffer() OVERRIDE;
+
+ // Interface to ImageTransportLayer:
+ CGLContextObj LayerShareGroupContext();
+ bool LayerCanDraw();
+ void LayerDoDraw();
private:
+ ImageTransportSurfaceFBO* transport_surface_;
+
+ // Set when a new swap occurs, and un-set when |layer_| draws that frame.
+ bool has_pending_draw_;
+
+ // A counter that is incremented whenever LayerCanDraw returns false. If this
+ // reaches a threshold, then |layer_| is switched to synchronous drawing to
+ // save CPU work.
+ uint32 can_draw_returned_false_count_;
+
+ // The texture with the pixels to draw, and the share group it is allocated
+ // in.
+ base::ScopedTypeRef<CGLContextObj> share_group_context_;
+ GLuint fbo_texture_;
+ gfx::Size fbo_pixel_size_;
+
+ // The CALayer that the current frame is being drawn into.
base::scoped_nsobject<CAContext> context_;
base::scoped_nsobject<ImageTransportLayer> layer_;
« no previous file with comments | « content/browser/gpu/gpu_process_host_ui_shim.cc ('k') | content/common/gpu/image_transport_surface_calayer_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698