| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Google Inc. All rights reserved. | 3 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 namespace blink { | 29 namespace blink { |
| 30 | 30 |
| 31 WebGLUniformLocation* WebGLUniformLocation::Create(WebGLProgram* program, | 31 WebGLUniformLocation* WebGLUniformLocation::Create(WebGLProgram* program, |
| 32 GLint location) { | 32 GLint location) { |
| 33 return new WebGLUniformLocation(program, location); | 33 return new WebGLUniformLocation(program, location); |
| 34 } | 34 } |
| 35 | 35 |
| 36 WebGLUniformLocation::WebGLUniformLocation(WebGLProgram* program, | 36 WebGLUniformLocation::WebGLUniformLocation(WebGLProgram* program, |
| 37 GLint location) | 37 GLint location) |
| 38 : program_(program), location_(location) { | 38 : program_(program), location_(location) { |
| 39 ASSERT(program_); | 39 DCHECK(program_); |
| 40 link_count_ = program_->LinkCount(); | 40 link_count_ = program_->LinkCount(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 WebGLProgram* WebGLUniformLocation::Program() const { | 43 WebGLProgram* WebGLUniformLocation::Program() const { |
| 44 // If the program has been linked again, then this UniformLocation is no | 44 // If the program has been linked again, then this UniformLocation is no |
| 45 // longer valid. | 45 // longer valid. |
| 46 if (program_->LinkCount() != link_count_) | 46 if (program_->LinkCount() != link_count_) |
| 47 return 0; | 47 return 0; |
| 48 return program_; | 48 return program_; |
| 49 } | 49 } |
| 50 | 50 |
| 51 GLint WebGLUniformLocation::Location() const { | 51 GLint WebGLUniformLocation::Location() const { |
| 52 // If the program has been linked again, then this UniformLocation is no | 52 // If the program has been linked again, then this UniformLocation is no |
| 53 // longer valid. | 53 // longer valid. |
| 54 ASSERT(program_->LinkCount() == link_count_); | 54 ASSERT(program_->LinkCount() == link_count_); |
| 55 return location_; | 55 return location_; |
| 56 } | 56 } |
| 57 | 57 |
| 58 DEFINE_TRACE(WebGLUniformLocation) { | 58 DEFINE_TRACE(WebGLUniformLocation) { |
| 59 visitor->Trace(program_); | 59 visitor->Trace(program_); |
| 60 } | 60 } |
| 61 | 61 |
| 62 } // namespace blink | 62 } // namespace blink |
| OLD | NEW |