OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrPictureUtils.h" | 8 #include "GrPictureUtils.h" |
9 #include "SkDevice.h" | 9 #include "SkDevice.h" |
10 #include "SkDraw.h" | 10 #include "SkDraw.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 fPicture = picture; | 34 fPicture = picture; |
35 fSaveLayerDepth = saveLayerDepth; | 35 fSaveLayerDepth = saveLayerDepth; |
36 fInfo.fValid = true; | 36 fInfo.fValid = true; |
37 fInfo.fSize.set(width, height); | 37 fInfo.fSize.set(width, height); |
38 fInfo.fPaint = NULL; | 38 fInfo.fPaint = NULL; |
39 fInfo.fSaveLayerOpID = fPicture->EXPERIMENTAL_curOpID(); | 39 fInfo.fSaveLayerOpID = fPicture->EXPERIMENTAL_curOpID(); |
40 fInfo.fRestoreOpID = 0; | 40 fInfo.fRestoreOpID = 0; |
41 fInfo.fHasNestedLayers = false; | 41 fInfo.fHasNestedLayers = false; |
42 fInfo.fIsNested = (2 == fSaveLayerDepth); | 42 fInfo.fIsNested = (2 == fSaveLayerDepth); |
43 | 43 |
44 fEmptyBitmap.setInfo(SkImageInfo::MakeUnknown(fInfo.fSize.fWidth, fInfo.
fSize.fHeight)); | 44 fEmptyBitmap.setConfig(SkImageInfo::Make(fInfo.fSize.fWidth, |
| 45 fInfo.fSize.fHeight, |
| 46 kUnknown_SkColorType, |
| 47 kIgnore_SkAlphaType)); |
45 fAccelData = accelData; | 48 fAccelData = accelData; |
46 fAlreadyDrawn = false; | 49 fAlreadyDrawn = false; |
47 } | 50 } |
48 | 51 |
49 virtual ~GrGatherDevice() { } | 52 virtual ~GrGatherDevice() { } |
50 | 53 |
51 virtual int width() const SK_OVERRIDE { return fInfo.fSize.width(); } | 54 virtual int width() const SK_OVERRIDE { return fInfo.fSize.width(); } |
52 virtual int height() const SK_OVERRIDE { return fInfo.fSize.height(); } | 55 virtual int height() const SK_OVERRIDE { return fInfo.fSize.height(); } |
53 virtual bool isOpaque() const SK_OVERRIDE { return false; } | 56 virtual bool isOpaque() const SK_OVERRIDE { return false; } |
54 virtual SkBitmap::Config config() const SK_OVERRIDE { | 57 virtual SkBitmap::Config config() const SK_OVERRIDE { |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 void GatherGPUInfo(SkPicture* pict, GPUAccelData* accelData) { | 278 void GatherGPUInfo(SkPicture* pict, GPUAccelData* accelData) { |
276 if (0 == pict->width() || 0 == pict->height()) { | 279 if (0 == pict->width() || 0 == pict->height()) { |
277 return ; | 280 return ; |
278 } | 281 } |
279 | 282 |
280 GrGatherDevice device(pict->width(), pict->height(), pict, accelData, 0); | 283 GrGatherDevice device(pict->width(), pict->height(), pict, accelData, 0); |
281 GrGatherCanvas canvas(&device, pict); | 284 GrGatherCanvas canvas(&device, pict); |
282 | 285 |
283 canvas.gather(); | 286 canvas.gather(); |
284 } | 287 } |
OLD | NEW |