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

Side by Side Diff: src/gpu/GrSWMaskHelper.cpp

Issue 432143002: Add ETC1 format to SkTextureCompressor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add default clause to texture compressor. Created 6 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
« no previous file with comments | « gyp/utils.gyp ('k') | src/images/SkImageDecoder_pkm.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrSWMaskHelper.h" 8 #include "GrSWMaskHelper.h"
9 9
10 #include "GrDrawState.h" 10 #include "GrDrawState.h"
(...skipping 22 matching lines...) Expand all
33 SkXfermode::kSrc_Mode, // kReplace_Op 33 SkXfermode::kSrc_Mode, // kReplace_Op
34 }; 34 };
35 35
36 return modeMap[op]; 36 return modeMap[op];
37 } 37 }
38 38
39 static inline GrPixelConfig fmt_to_config(SkTextureCompressor::Format fmt) { 39 static inline GrPixelConfig fmt_to_config(SkTextureCompressor::Format fmt) {
40 static const GrPixelConfig configMap[] = { 40 static const GrPixelConfig configMap[] = {
41 kLATC_GrPixelConfig, // kLATC_Format, 41 kLATC_GrPixelConfig, // kLATC_Format,
42 kR11_EAC_GrPixelConfig, // kR11_EAC_Format, 42 kR11_EAC_GrPixelConfig, // kR11_EAC_Format,
43 kETC1_GrPixelConfig, // kETC1_Format,
43 kASTC_12x12_GrPixelConfig // kASTC_12x12_Format, 44 kASTC_12x12_GrPixelConfig // kASTC_12x12_Format,
44 }; 45 };
45 GR_STATIC_ASSERT(0 == SkTextureCompressor::kLATC_Format); 46 GR_STATIC_ASSERT(0 == SkTextureCompressor::kLATC_Format);
46 GR_STATIC_ASSERT(1 == SkTextureCompressor::kR11_EAC_Format); 47 GR_STATIC_ASSERT(1 == SkTextureCompressor::kR11_EAC_Format);
47 GR_STATIC_ASSERT(2 == SkTextureCompressor::kASTC_12x12_Format); 48 GR_STATIC_ASSERT(2 == SkTextureCompressor::kETC1_Format);
49 GR_STATIC_ASSERT(3 == SkTextureCompressor::kASTC_12x12_Format);
48 GR_STATIC_ASSERT(SK_ARRAY_COUNT(configMap) == SkTextureCompressor::kFormatCn t); 50 GR_STATIC_ASSERT(SK_ARRAY_COUNT(configMap) == SkTextureCompressor::kFormatCn t);
49 51
50 return configMap[fmt]; 52 return configMap[fmt];
51 } 53 }
52 54
53 #if GR_COMPRESS_ALPHA_MASK 55 #if GR_COMPRESS_ALPHA_MASK
54 static bool choose_compressed_fmt(const GrDrawTargetCaps* caps, 56 static bool choose_compressed_fmt(const GrDrawTargetCaps* caps,
55 SkTextureCompressor::Format *fmt) { 57 SkTextureCompressor::Format *fmt) {
56 if (NULL == fmt) { 58 if (NULL == fmt) {
57 return false; 59 return false;
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 maskMatrix.preConcat(drawState->getViewMatrix()); 317 maskMatrix.preConcat(drawState->getViewMatrix());
316 318
317 drawState->addCoverageEffect( 319 drawState->addCoverageEffect(
318 GrSimpleTextureEffect::Create(texture, 320 GrSimpleTextureEffect::Create(texture,
319 maskMatrix, 321 maskMatrix,
320 GrTextureParams::kNone_Fi lterMode, 322 GrTextureParams::kNone_Fi lterMode,
321 kPosition_GrCoordSet))->u nref(); 323 kPosition_GrCoordSet))->u nref();
322 324
323 target->drawSimpleRect(dstRect); 325 target->drawSimpleRect(dstRect);
324 } 326 }
OLDNEW
« no previous file with comments | « gyp/utils.gyp ('k') | src/images/SkImageDecoder_pkm.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698