OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #include "config.h" | |
6 | |
7 #include "cc/resource_provider.h" | 5 #include "cc/resource_provider.h" |
8 | 6 |
9 #include <limits.h> | 7 #include <limits.h> |
10 | 8 |
11 #include "base/debug/alias.h" | 9 #include "base/debug/alias.h" |
12 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
13 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
14 #include "base/string_split.h" | 12 #include "base/string_split.h" |
15 #include "base/string_util.h" | 13 #include "base/string_util.h" |
16 #include "cc/gl_renderer.h" // For the GLC() macro. | 14 #include "cc/gl_renderer.h" // For the GLC() macro. |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
146 ResourceProvider::ResourceId ResourceProvider::createResource(int pool, const gf x::Size& size, GLenum format, TextureUsageHint hint) | 144 ResourceProvider::ResourceId ResourceProvider::createResource(int pool, const gf x::Size& size, GLenum format, TextureUsageHint hint) |
147 { | 145 { |
148 switch (m_defaultResourceType) { | 146 switch (m_defaultResourceType) { |
149 case GLTexture: | 147 case GLTexture: |
150 return createGLTexture(pool, size, format, hint); | 148 return createGLTexture(pool, size, format, hint); |
151 case Bitmap: | 149 case Bitmap: |
152 DCHECK(format == GL_RGBA); | 150 DCHECK(format == GL_RGBA); |
153 return createBitmap(pool, size); | 151 return createBitmap(pool, size); |
154 } | 152 } |
155 | 153 |
156 CRASH(); | 154 NOTREACHED(); |
jamesr
2012/11/10 01:12:18
NOTREACHED() is a DCHECK(), CRASH() is a, well, CR
piman
2012/11/10 01:28:36
Done.
| |
157 return 0; | 155 return 0; |
158 } | 156 } |
159 | 157 |
160 ResourceProvider::ResourceId ResourceProvider::createGLTexture(int pool, const g fx::Size& size, GLenum format, TextureUsageHint hint) | 158 ResourceProvider::ResourceId ResourceProvider::createGLTexture(int pool, const g fx::Size& size, GLenum format, TextureUsageHint hint) |
161 { | 159 { |
162 DCHECK(m_threadChecker.CalledOnValidThread()); | 160 DCHECK(m_threadChecker.CalledOnValidThread()); |
163 unsigned textureId = 0; | 161 unsigned textureId = 0; |
164 WebGraphicsContext3D* context3d = m_context->context3D(); | 162 WebGraphicsContext3D* context3d = m_context->context3D(); |
165 DCHECK(context3d); | 163 DCHECK(context3d); |
166 GLC(context3d, textureId = context3d->createTexture()); | 164 GLC(context3d, textureId = context3d->createTexture()); |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
685 g_debugZone = zone; | 683 g_debugZone = zone; |
686 } | 684 } |
687 | 685 |
688 void ResourceProvider::debugNotifyLeaveZone() | 686 void ResourceProvider::debugNotifyLeaveZone() |
689 { | 687 { |
690 g_debugZone = 0; | 688 g_debugZone = 0; |
691 } | 689 } |
692 | 690 |
693 | 691 |
694 } // namespace cc | 692 } // namespace cc |
OLD | NEW |