| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_CONTEXT_MAC_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_CONTEXT_MAC_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_CONTEXT_MAC_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_CONTEXT_MAC_H_ |
| 7 | 7 |
| 8 #import <AppKit/NSOpenGL.h> | 8 #import <AppKit/NSOpenGL.h> |
| 9 #include <OpenGL/OpenGL.h> | 9 #include <OpenGL/OpenGL.h> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 CORE_ANIMATION_DISABLED, | 23 CORE_ANIMATION_DISABLED, |
| 24 CORE_ANIMATION_ENABLED, | 24 CORE_ANIMATION_ENABLED, |
| 25 }; | 25 }; |
| 26 CoreAnimationStatus GetCoreAnimationStatus(); | 26 CoreAnimationStatus GetCoreAnimationStatus(); |
| 27 | 27 |
| 28 class CompositingIOSurfaceShaderPrograms; | 28 class CompositingIOSurfaceShaderPrograms; |
| 29 | 29 |
| 30 class CompositingIOSurfaceContext | 30 class CompositingIOSurfaceContext |
| 31 : public base::RefCounted<CompositingIOSurfaceContext> { | 31 : public base::RefCounted<CompositingIOSurfaceContext> { |
| 32 public: | 32 public: |
| 33 enum { kOffscreenContextWindowNumber = -2 }; | 33 enum { |
| 34 // The number used to look up the context used for async readback and for |
| 35 // initializing the IOSurface. |
| 36 kOffscreenContextWindowNumber = -2, |
| 37 // The number used to look up the context used by CAOpenGLLayers. |
| 38 kCALayerContextWindowNumber = -3, |
| 39 }; |
| 34 | 40 |
| 35 // Get or create a GL context for the specified window with the specified | 41 // Get or create a GL context for the specified window with the specified |
| 36 // surface ordering. Share these GL contexts as much as possible because | 42 // surface ordering. Share these GL contexts as much as possible because |
| 37 // creating and destroying them can be expensive | 43 // creating and destroying them can be expensive |
| 38 // http://crbug.com/180463 | 44 // http://crbug.com/180463 |
| 39 static scoped_refptr<CompositingIOSurfaceContext> Get(int window_number); | 45 static scoped_refptr<CompositingIOSurfaceContext> Get(int window_number); |
| 40 | 46 |
| 41 // Mark that all the currently existing GL contexts shouldn't be returned | 47 // Mark that all the currently existing GL contexts shouldn't be returned |
| 42 // anymore by Get, but rather, new contexts should be created. This is | 48 // anymore by Get, but rather, new contexts should be created. This is |
| 43 // called as a precaution when unexpected GL errors occur. | 49 // called as a precaution when unexpected GL errors occur. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 // The global map from window number and window ordering to | 94 // The global map from window number and window ordering to |
| 89 // context data. | 95 // context data. |
| 90 typedef std::map<int, CompositingIOSurfaceContext*> WindowMap; | 96 typedef std::map<int, CompositingIOSurfaceContext*> WindowMap; |
| 91 static base::LazyInstance<WindowMap> window_map_; | 97 static base::LazyInstance<WindowMap> window_map_; |
| 92 static WindowMap* window_map(); | 98 static WindowMap* window_map(); |
| 93 }; | 99 }; |
| 94 | 100 |
| 95 } // namespace content | 101 } // namespace content |
| 96 | 102 |
| 97 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_CONTEXT_MAC_H_ | 103 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_CONTEXT_MAC_H_ |
| OLD | NEW |