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

Unified Diff: content/browser/renderer_host/compositing_iosurface_mac.h

Issue 16189012: Add a path to use CALayers to display content (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporate review feedback Created 7 years, 7 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/browser/renderer_host/compositing_iosurface_mac.h
diff --git a/content/browser/renderer_host/compositing_iosurface_mac.h b/content/browser/renderer_host/compositing_iosurface_mac.h
index 2f1e11a2e01153db5759af5a1a716b5185e41dfc..2200de301c5c2ac21d7ed6c10057fb53dd01328f 100644
--- a/content/browser/renderer_host/compositing_iosurface_mac.h
+++ b/content/browser/renderer_host/compositing_iosurface_mac.h
@@ -37,6 +37,7 @@ class CompositingIOSurfaceContext;
class CompositingIOSurfaceShaderPrograms;
class CompositingIOSurfaceTransformer;
class RenderWidgetHostViewFrameSubscriber;
+class RenderWidgetHostViewMac;
// This class manages an OpenGL context and IOSurface for the accelerated
// compositing code path. The GL context is attached to
@@ -55,6 +56,8 @@ class CompositingIOSurfaceMac {
// window.
static CompositingIOSurfaceMac* Create(int window_number,
SurfaceOrder order);
+ static CompositingIOSurfaceMac* Create(
+ const scoped_refptr<CompositingIOSurfaceContext>& context);
~CompositingIOSurfaceMac();
// Set IOSurface that will be drawn on the next NSView drawRect.
@@ -65,16 +68,15 @@ class CompositingIOSurfaceMac {
// Get the CGL renderer ID currently associated with this context.
int GetRendererID();
- // Blit the IOSurface at the upper-left corner of the |view|. If |view| window
- // size is larger than the IOSurface, the remaining right and bottom edges
- // will be white. |scaleFactor| is 1 in normal views, 2 in HiDPI views.
- // |frame_subscriber| listens to this draw event and provides output buffer
- // for copying this frame into.
- void DrawIOSurface(NSView* view,
- float scale_factor,
- int window_number,
- SurfaceOrder surface_order,
+ // Blit the IOSurface at the upper-left corner of the of the specified
+ // window_size. If the window size is larger than the IOSurface, the
+ // remaining right and bottom edges will be white. |scaleFactor| is 1
+ // in normal views, 2 in HiDPI views. |frame_subscriber| listens to
+ // this draw event and provides output buffer for copying this frame into.
+ void DrawIOSurface(const gfx::Size& window_size,
+ float window_scale_factor,
RenderWidgetHostViewFrameSubscriber* frame_subscriber);
+ void DrawIOSurface(RenderWidgetHostViewMac* render_widget_host_view);
// Copy the data of the "live" OpenGL texture referring to this IOSurfaceRef
// into |out|. The copied region is specified with |src_pixel_subrect| and
@@ -113,9 +115,14 @@ class CompositingIOSurfaceMac {
}
// In cocoa view units / DIPs.
const gfx::Size& dip_io_surface_size() const { return dip_io_surface_size_; }
+ float scale_factor() const { return scale_factor_; }
bool is_vsync_disabled() const;
+ const scoped_refptr<CompositingIOSurfaceContext>& context() {
+ return context_;
+ }
+
// Get vsync scheduling parameters.
// |interval_numerator/interval_denominator| equates to fractional number of
// seconds between vsyncs.
@@ -222,7 +229,7 @@ class CompositingIOSurfaceMac {
CompositingIOSurfaceMac(
IOSurfaceSupport* io_surface_support,
- scoped_refptr<CompositingIOSurfaceContext> context);
+ const scoped_refptr<CompositingIOSurfaceContext>& context);
void SetupCVDisplayLink();
@@ -315,6 +322,7 @@ class CompositingIOSurfaceMac {
// The width and height of the io surface.
gfx::Size pixel_io_surface_size_; // In pixels.
gfx::Size dip_io_surface_size_; // In view / density independent pixels.
+ float scale_factor_;
// The "live" OpenGL texture referring to this IOSurfaceRef. Note
// that per the CGLTexImageIOSurface2D API we do not need to

Powered by Google App Engine
This is Rietveld 408576698