OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "SkColorPriv.h" | 8 #include "SkColorPriv.h" |
9 #include "SkReadBuffer.h" | 9 #include "SkReadBuffer.h" |
10 #include "SkWriteBuffer.h" | 10 #include "SkWriteBuffer.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 } | 32 } |
33 | 33 |
34 SkBitmapProcShader::SkBitmapProcShader(const SkBitmap& src, TileMode tmx, TileMo
de tmy, | 34 SkBitmapProcShader::SkBitmapProcShader(const SkBitmap& src, TileMode tmx, TileMo
de tmy, |
35 const SkMatrix* localMatrix) | 35 const SkMatrix* localMatrix) |
36 : INHERITED(localMatrix) { | 36 : INHERITED(localMatrix) { |
37 fRawBitmap = src; | 37 fRawBitmap = src; |
38 fTileModeX = (uint8_t)tmx; | 38 fTileModeX = (uint8_t)tmx; |
39 fTileModeY = (uint8_t)tmy; | 39 fTileModeY = (uint8_t)tmy; |
40 } | 40 } |
41 | 41 |
42 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING | |
43 SkBitmapProcShader::SkBitmapProcShader(SkReadBuffer& buffer) : INHERITED(buffer)
{ | |
44 buffer.readBitmap(&fRawBitmap); | |
45 fRawBitmap.setImmutable(); | |
46 fTileModeX = buffer.readUInt(); | |
47 fTileModeY = buffer.readUInt(); | |
48 } | |
49 #endif | |
50 | |
51 SkShader::BitmapType SkBitmapProcShader::asABitmap(SkBitmap* texture, | 42 SkShader::BitmapType SkBitmapProcShader::asABitmap(SkBitmap* texture, |
52 SkMatrix* texM, | 43 SkMatrix* texM, |
53 TileMode xy[]) const { | 44 TileMode xy[]) const { |
54 if (texture) { | 45 if (texture) { |
55 *texture = fRawBitmap; | 46 *texture = fRawBitmap; |
56 } | 47 } |
57 if (texM) { | 48 if (texM) { |
58 texM->reset(); | 49 texM->reset(); |
59 } | 50 } |
60 if (xy) { | 51 if (xy) { |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 | 474 |
484 #else | 475 #else |
485 | 476 |
486 bool SkBitmapProcShader::asFragmentProcessor(GrContext*, const SkPaint&, const S
kMatrix*, GrColor*, | 477 bool SkBitmapProcShader::asFragmentProcessor(GrContext*, const SkPaint&, const S
kMatrix*, GrColor*, |
487 GrFragmentProcessor**) const { | 478 GrFragmentProcessor**) const { |
488 SkDEBUGFAIL("Should not call in GPU-less build"); | 479 SkDEBUGFAIL("Should not call in GPU-less build"); |
489 return false; | 480 return false; |
490 } | 481 } |
491 | 482 |
492 #endif | 483 #endif |
OLD | NEW |