OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "gpu/command_buffer/service/texture_definition.h" |
| 6 |
| 7 namespace gpu { |
| 8 namespace gles2 { |
| 9 |
| 10 TextureDefinition::LevelInfo::LevelInfo(GLenum target, |
| 11 GLenum internal_format, |
| 12 GLsizei width, |
| 13 GLsizei height, |
| 14 GLsizei depth, |
| 15 GLint border, |
| 16 GLenum format, |
| 17 GLenum type, |
| 18 bool cleared) |
| 19 : target(target), |
| 20 internal_format(internal_format), |
| 21 width(width), |
| 22 height(height), |
| 23 depth(depth), |
| 24 border(border), |
| 25 format(format), |
| 26 type(type), |
| 27 cleared(cleared) { |
| 28 } |
| 29 |
| 30 TextureDefinition::TextureDefinition(GLenum target, |
| 31 GLuint service_id, |
| 32 const LevelInfos& level_infos) |
| 33 : target_(target), |
| 34 service_id_(service_id), |
| 35 level_infos_(level_infos) { |
| 36 } |
| 37 |
| 38 TextureDefinition::~TextureDefinition() { |
| 39 DCHECK_EQ(0U, service_id_) << "TextureDefinition leaked texture."; |
| 40 } |
| 41 |
| 42 GLuint TextureDefinition::ReleaseServiceId() { |
| 43 GLuint service_id = service_id_; |
| 44 service_id_ = 0; |
| 45 return service_id; |
| 46 } |
| 47 |
| 48 } // namespace gles2 |
| 49 } // namespace gpu |
OLD | NEW |