OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <list> | 10 #include <list> |
(...skipping 1493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1504 void Texture::Create() { | 1504 void Texture::Create() { |
1505 ScopedGLErrorSuppressor suppressor(decoder_); | 1505 ScopedGLErrorSuppressor suppressor(decoder_); |
1506 Destroy(); | 1506 Destroy(); |
1507 glGenTextures(1, &id_); | 1507 glGenTextures(1, &id_); |
1508 } | 1508 } |
1509 | 1509 |
1510 bool Texture::AllocateStorage(const gfx::Size& size, GLenum format) { | 1510 bool Texture::AllocateStorage(const gfx::Size& size, GLenum format) { |
1511 DCHECK_NE(id_, 0u); | 1511 DCHECK_NE(id_, 0u); |
1512 ScopedGLErrorSuppressor suppressor(decoder_); | 1512 ScopedGLErrorSuppressor suppressor(decoder_); |
1513 ScopedTexture2DBinder binder(decoder_, id_); | 1513 ScopedTexture2DBinder binder(decoder_, id_); |
1514 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); | |
1515 glTexParameteri( | |
1516 GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); | |
1517 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | |
1518 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); | |
1519 | 1514 |
1520 glTexImage2D(GL_TEXTURE_2D, | 1515 glTexImage2D(GL_TEXTURE_2D, |
1521 0, // mip level | 1516 0, // mip level |
1522 format, | 1517 format, |
1523 size.width(), | 1518 size.width(), |
1524 size.height(), | 1519 size.height(), |
1525 0, // border | 1520 0, // border |
1526 format, | 1521 format, |
1527 GL_UNSIGNED_BYTE, | 1522 GL_UNSIGNED_BYTE, |
1528 NULL); | 1523 NULL); |
(...skipping 4182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5711 return error::kNoError; | 5706 return error::kNoError; |
5712 } | 5707 } |
5713 | 5708 |
5714 // Include the auto-generated part of this file. We split this because it means | 5709 // Include the auto-generated part of this file. We split this because it means |
5715 // we can easily edit the non-auto generated parts right here in this file | 5710 // we can easily edit the non-auto generated parts right here in this file |
5716 // instead of having to edit some template or the code generator. | 5711 // instead of having to edit some template or the code generator. |
5717 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 5712 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
5718 | 5713 |
5719 } // namespace gles2 | 5714 } // namespace gles2 |
5720 } // namespace gpu | 5715 } // namespace gpu |
OLD | NEW |