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

Side by Side Diff: content/browser/renderer_host/compositing_iosurface_context_mac.h

Issue 164873006: Do not share a GL context between CoreAnimation and async readback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More comments Created 6 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/renderer_host/compositing_iosurface_layer_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/compositing_iosurface_layer_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698