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 |
42 SkShader::BitmapType SkBitmapProcShader::asABitmap(SkBitmap* texture, | 51 SkShader::BitmapType SkBitmapProcShader::asABitmap(SkBitmap* texture, |
43 SkMatrix* texM, | 52 SkMatrix* texM, |
44 TileMode xy[]) const { | 53 TileMode xy[]) const { |
45 if (texture) { | 54 if (texture) { |
46 *texture = fRawBitmap; | 55 *texture = fRawBitmap; |
47 } | 56 } |
48 if (texM) { | 57 if (texM) { |
49 texM->reset(); | 58 texM->reset(); |
50 } | 59 } |
51 if (xy) { | 60 if (xy) { |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 | 483 |
475 #else | 484 #else |
476 | 485 |
477 bool SkBitmapProcShader::asFragmentProcessor(GrContext*, const SkPaint&, const S
kMatrix*, GrColor*, | 486 bool SkBitmapProcShader::asFragmentProcessor(GrContext*, const SkPaint&, const S
kMatrix*, GrColor*, |
478 GrFragmentProcessor**) const { | 487 GrFragmentProcessor**) const { |
479 SkDEBUGFAIL("Should not call in GPU-less build"); | 488 SkDEBUGFAIL("Should not call in GPU-less build"); |
480 return false; | 489 return false; |
481 } | 490 } |
482 | 491 |
483 #endif | 492 #endif |
OLD | NEW |