OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 , m_minFilter(GraphicsContext3D::NEAREST_MIPMAP_LINEAR) | 44 , m_minFilter(GraphicsContext3D::NEAREST_MIPMAP_LINEAR) |
45 , m_magFilter(GraphicsContext3D::LINEAR) | 45 , m_magFilter(GraphicsContext3D::LINEAR) |
46 , m_wrapS(GraphicsContext3D::REPEAT) | 46 , m_wrapS(GraphicsContext3D::REPEAT) |
47 , m_wrapT(GraphicsContext3D::REPEAT) | 47 , m_wrapT(GraphicsContext3D::REPEAT) |
48 , m_isNPOT(false) | 48 , m_isNPOT(false) |
49 , m_isComplete(false) | 49 , m_isComplete(false) |
50 , m_needToUseBlackTexture(false) | 50 , m_needToUseBlackTexture(false) |
51 , m_isFloatType(false) | 51 , m_isFloatType(false) |
52 , m_isHalfFloatType(false) | 52 , m_isHalfFloatType(false) |
53 { | 53 { |
| 54 ScriptWrappable::init(this); |
54 setObject(ctx->graphicsContext3D()->createTexture()); | 55 setObject(ctx->graphicsContext3D()->createTexture()); |
55 } | 56 } |
56 | 57 |
57 WebGLTexture::~WebGLTexture() | 58 WebGLTexture::~WebGLTexture() |
58 { | 59 { |
59 deleteObject(0); | 60 deleteObject(0); |
60 } | 61 } |
61 | 62 |
62 void WebGLTexture::setTarget(GC3Denum target, GC3Dint maxLevel) | 63 void WebGLTexture::setTarget(GC3Denum target, GC3Dint maxLevel) |
63 { | 64 { |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 return 0; | 388 return 0; |
388 int targetIndex = mapTargetToIndex(target); | 389 int targetIndex = mapTargetToIndex(target); |
389 if (targetIndex < 0 || targetIndex >= static_cast<int>(m_info.size())) | 390 if (targetIndex < 0 || targetIndex >= static_cast<int>(m_info.size())) |
390 return 0; | 391 return 0; |
391 if (level < 0 || level >= static_cast<GC3Dint>(m_info[targetIndex].size())) | 392 if (level < 0 || level >= static_cast<GC3Dint>(m_info[targetIndex].size())) |
392 return 0; | 393 return 0; |
393 return &(m_info[targetIndex][level]); | 394 return &(m_info[targetIndex][level]); |
394 } | 395 } |
395 | 396 |
396 } | 397 } |
OLD | NEW |