Home | History | Annotate | Download | only in renderer_host
      1 // Copyright 2013 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_LAYER_MAC_H_
      6 #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_LAYER_MAC_H_
      7 
      8 #import <Cocoa/Cocoa.h>
      9 
     10 #include "base/mac/scoped_cftyperef.h"
     11 #include "base/memory/ref_counted.h"
     12 
     13 namespace content {
     14 class CompositingIOSurfaceContext;
     15 class RenderWidgetHostViewMac;
     16 }
     17 
     18 // The CoreAnimation layer for drawing accelerated content.
     19 @interface CompositingIOSurfaceLayer : CAOpenGLLayer {
     20  @private
     21   content::RenderWidgetHostViewMac* renderWidgetHostView_;
     22   scoped_refptr<content::CompositingIOSurfaceContext> context_;
     23 }
     24 
     25 @property(nonatomic, readonly)
     26     scoped_refptr<content::CompositingIOSurfaceContext> context;
     27 
     28 - (id)initWithRenderWidgetHostViewMac:(content::RenderWidgetHostViewMac*)r;
     29 
     30 // Update the scale factor of the layer to match the scale factor of the
     31 // IOSurface.
     32 - (void)updateScaleFactor;
     33 
     34 // Remove this layer from the layer heirarchy, and mark that
     35 // |renderWidgetHostView_| is no longer valid and may no longer be dereferenced.
     36 - (void)disableCompositing;
     37 
     38 @end
     39 
     40 #endif  // CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_LAYER_MAC_H_
     41