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

Side by Side Diff: Source/core/html/canvas/WebGLTexture.cpp

Issue 15481002: Make WebGL objects scriptwrappable so that binding integrity checks may be applied to them. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 : WebGLSharedObject(ctx) 42 : WebGLSharedObject(ctx)
43 , m_target(0) 43 , m_target(0)
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 { 51 {
52 ScriptWrappable::init(this);
52 setObject(ctx->graphicsContext3D()->createTexture()); 53 setObject(ctx->graphicsContext3D()->createTexture());
53 } 54 }
54 55
55 WebGLTexture::~WebGLTexture() 56 WebGLTexture::~WebGLTexture()
56 { 57 {
57 deleteObject(0); 58 deleteObject(0);
58 } 59 }
59 60
60 void WebGLTexture::setTarget(GC3Denum target, GC3Dint maxLevel) 61 void WebGLTexture::setTarget(GC3Denum target, GC3Dint maxLevel)
61 { 62 {
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 return 0; 358 return 0;
358 int targetIndex = mapTargetToIndex(target); 359 int targetIndex = mapTargetToIndex(target);
359 if (targetIndex < 0 || targetIndex >= static_cast<int>(m_info.size())) 360 if (targetIndex < 0 || targetIndex >= static_cast<int>(m_info.size()))
360 return 0; 361 return 0;
361 if (level < 0 || level >= static_cast<GC3Dint>(m_info[targetIndex].size())) 362 if (level < 0 || level >= static_cast<GC3Dint>(m_info[targetIndex].size()))
362 return 0; 363 return 0;
363 return &(m_info[targetIndex][level]); 364 return &(m_info[targetIndex][level]);
364 } 365 }
365 366
366 } 367 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698