| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // This object has been invalidated. | 53 // This object has been invalidated. |
| 54 return; | 54 return; |
| 55 } | 55 } |
| 56 | 56 |
| 57 if (!attachment_count_) { | 57 if (!attachment_count_) { |
| 58 if (!gl) | 58 if (!gl) |
| 59 gl = GetAGLInterface(); | 59 gl = GetAGLInterface(); |
| 60 if (gl) { | 60 if (gl) { |
| 61 DeleteObjectImpl(gl); | 61 DeleteObjectImpl(gl); |
| 62 // Ensure the inherited class no longer claims to have a valid object | 62 // Ensure the inherited class no longer claims to have a valid object |
| 63 ASSERT(!HasObject()); | 63 DCHECK(!HasObject()); |
| 64 } | 64 } |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 | 67 |
| 68 void WebGLObject::Detach() { | 68 void WebGLObject::Detach() { |
| 69 attachment_count_ = 0; // Make sure OpenGL resource is deleted. | 69 attachment_count_ = 0; // Make sure OpenGL resource is deleted. |
| 70 } | 70 } |
| 71 | 71 |
| 72 void WebGLObject::DetachAndDeleteObject() { | 72 void WebGLObject::DetachAndDeleteObject() { |
| 73 // To ensure that all platform objects are deleted after being detached, | 73 // To ensure that all platform objects are deleted after being detached, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 92 void WebGLObject::OnDetached(gpu::gles2::GLES2Interface* gl) { | 92 void WebGLObject::OnDetached(gpu::gles2::GLES2Interface* gl) { |
| 93 if (attachment_count_) | 93 if (attachment_count_) |
| 94 --attachment_count_; | 94 --attachment_count_; |
| 95 if (deleted_) | 95 if (deleted_) |
| 96 DeleteObject(gl); | 96 DeleteObject(gl); |
| 97 } | 97 } |
| 98 | 98 |
| 99 DEFINE_TRACE_WRAPPERS(WebGLObject) {} | 99 DEFINE_TRACE_WRAPPERS(WebGLObject) {} |
| 100 | 100 |
| 101 } // namespace blink | 101 } // namespace blink |
| OLD | NEW |