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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLTexture.cpp

Issue 2547813002: Remove WebGLObject maps from WebGLRenderingContextBase and WebGLContextGroup. (Closed)
Patch Set: Fixed WebGLContextObject::validate. Made WebGLExtension non-finalized. Created 4 years 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
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 24 matching lines...) Expand all
35 } 35 }
36 36
37 WebGLTexture::WebGLTexture(WebGLRenderingContextBase* ctx) 37 WebGLTexture::WebGLTexture(WebGLRenderingContextBase* ctx)
38 : WebGLSharedPlatform3DObject(ctx), m_target(0) { 38 : WebGLSharedPlatform3DObject(ctx), m_target(0) {
39 GLuint texture; 39 GLuint texture;
40 ctx->contextGL()->GenTextures(1, &texture); 40 ctx->contextGL()->GenTextures(1, &texture);
41 setObject(texture); 41 setObject(texture);
42 } 42 }
43 43
44 WebGLTexture::~WebGLTexture() { 44 WebGLTexture::~WebGLTexture() {
45 // See the comment in WebGLObject::detachAndDeleteObject(). 45 runDestructor();
46 detachAndDeleteObject();
47 } 46 }
48 47
49 void WebGLTexture::setTarget(GLenum target) { 48 void WebGLTexture::setTarget(GLenum target) {
50 if (!object()) 49 if (!object())
51 return; 50 return;
52 // Target is finalized the first time bindTexture() is called. 51 // Target is finalized the first time bindTexture() is called.
53 if (m_target) 52 if (m_target)
54 return; 53 return;
55 m_target = target; 54 m_target = target;
56 } 55 }
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 if (x) { 103 if (x) {
105 value = x; 104 value = x;
106 log += shift; 105 log += shift;
107 } 106 }
108 } 107 }
109 ASSERT(value == 1); 108 ASSERT(value == 1);
110 return log + 1; 109 return log + 1;
111 } 110 }
112 111
113 } // namespace blink 112 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698