OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 return m_context; | 63 return m_context; |
64 } | 64 } |
65 | 65 |
66 PassRefPtr<GraphicsContext3D> createContext() | 66 PassRefPtr<GraphicsContext3D> createContext() |
67 { | 67 { |
68 GraphicsContext3D::Attributes attributes; | 68 GraphicsContext3D::Attributes attributes; |
69 attributes.depth = false; | 69 attributes.depth = false; |
70 attributes.stencil = true; | 70 attributes.stencil = true; |
71 attributes.antialias = false; | 71 attributes.antialias = false; |
72 attributes.shareResources = true; | 72 attributes.shareResources = true; |
73 attributes.preferDiscreteGPU = true; | |
74 m_context = GraphicsContext3D::create(attributes, 0); | 73 m_context = GraphicsContext3D::create(attributes, 0); |
75 return m_context; | 74 return m_context; |
76 } | 75 } |
77 private: | 76 private: |
78 RefPtr<GraphicsContext3D> m_context; | 77 RefPtr<GraphicsContext3D> m_context; |
79 }; | 78 }; |
80 | 79 |
81 PassRefPtr<GraphicsContext3D> SharedGraphicsContext3D::get() | 80 PassRefPtr<GraphicsContext3D> SharedGraphicsContext3D::get() |
82 { | 81 { |
83 DEFINE_STATIC_LOCAL(SharedGraphicsContext3DImpl, impl, ()); | 82 DEFINE_STATIC_LOCAL(SharedGraphicsContext3DImpl, impl, ()); |
(...skipping 23 matching lines...) Expand all Loading... |
107 } | 106 } |
108 | 107 |
109 bool SharedGraphicsContext3D::createForImplThread() | 108 bool SharedGraphicsContext3D::createForImplThread() |
110 { | 109 { |
111 ASSERT(isMainThread()); | 110 ASSERT(isMainThread()); |
112 return getOrCreateContextForImplThread(Create); | 111 return getOrCreateContextForImplThread(Create); |
113 } | 112 } |
114 | 113 |
115 } | 114 } |
116 | 115 |
OLD | NEW |