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

Side by Side Diff: Source/modules/webgl/WebGLCompressedTextureASTC.cpp

Issue 1265703005: Implement the texture uploading of ASTC compression for WebGL(part II) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 months 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
(Empty)
1 // Copyright 2015 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 "config.h"
6
7 #include "modules/webgl/WebGLCompressedTextureASTC.h"
8
9 #include "modules/webgl/WebGLRenderingContextBase.h"
10
11 namespace blink {
12
13 const WebGLCompressedTextureASTC::BlockSizeCompressASTC
14 WebGLCompressedTextureASTC::kBlockSizeCompressASTC[] =
15 {
16 GL_COMPRESSED_RGBA_ASTC_4x4_KHR, 4, 4,
17 GL_COMPRESSED_RGBA_ASTC_5x4_KHR, 5, 4,
18 GL_COMPRESSED_RGBA_ASTC_5x5_KHR, 5, 5,
19 GL_COMPRESSED_RGBA_ASTC_6x5_KHR, 6, 5,
20 GL_COMPRESSED_RGBA_ASTC_6x6_KHR, 6, 6,
21 GL_COMPRESSED_RGBA_ASTC_8x5_KHR, 8, 5,
22 GL_COMPRESSED_RGBA_ASTC_8x6_KHR, 8, 6,
23 GL_COMPRESSED_RGBA_ASTC_8x8_KHR, 8, 8,
24 GL_COMPRESSED_RGBA_ASTC_10x5_KHR, 10, 5,
25 GL_COMPRESSED_RGBA_ASTC_10x6_KHR, 10, 6,
26 GL_COMPRESSED_RGBA_ASTC_10x8_KHR, 10, 8,
27 GL_COMPRESSED_RGBA_ASTC_10x10_KHR, 10, 10,
28 GL_COMPRESSED_RGBA_ASTC_12x10_KHR, 12, 10,
29 GL_COMPRESSED_RGBA_ASTC_12x12_KHR, 12, 12,
30 GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR, 4, 4,
31 GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR, 5, 4,
32 GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR, 5, 5,
33 GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR, 6, 5,
34 GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR, 6, 6,
35 GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR, 8, 5,
36 GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR, 8, 6,
37 GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR, 8, 8,
38 GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR, 10, 5,
39 GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR, 10, 6,
40 GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR, 10, 8,
41 GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR, 10, 10,
42 GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, 12, 10,
43 GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, 12, 12
44 };
45
46 const int WebGLCompressedTextureASTC::kSizeOfBlockSizeCompressASTC =
47 sizeof(WebGLCompressedTextureASTC::kBlockSizeCompressASTC) /
48 sizeof(WebGLCompressedTextureASTC::kBlockSizeCompressASTC[0]);
49
50 WebGLCompressedTextureASTC::WebGLCompressedTextureASTC(WebGLRenderingContextBase * context)
51 : WebGLExtension(context)
52 {
53 for (int i = 0; i < WebGLCompressedTextureASTC::kSizeOfBlockSizeCompressASTC ; i++) {
54 context->addCompressedTextureFormat(
55 WebGLCompressedTextureASTC::kBlockSizeCompressASTC[i].CompressType);
56 }
57 }
58
59 WebGLCompressedTextureASTC::~WebGLCompressedTextureASTC()
60 {
61 }
62
63 WebGLExtensionName WebGLCompressedTextureASTC::name() const
64 {
65 return WebGLCompressedTextureASTCName;
66 }
67
68 PassRefPtrWillBeRawPtr<WebGLCompressedTextureASTC> WebGLCompressedTextureASTC::c reate(WebGLRenderingContextBase* context)
69 {
70 return adoptRefWillBeNoop(new WebGLCompressedTextureASTC(context));
71 }
72
73 bool WebGLCompressedTextureASTC::supported(WebGLRenderingContextBase* context)
74 {
75 Extensions3DUtil* extensionsUtil = context->extensionsUtil();
76 return extensionsUtil->supportsExtension("GL_KHR_texture_compression_astc_ld r");
77 }
78
79 const char* WebGLCompressedTextureASTC::extensionName()
80 {
81 return "WEBGL_compressed_texture_astc";
bajones 2015/08/07 22:01:09 The intermixing of "compressed_texture_astc" and "
82 }
83
84 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698