| 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 30 matching lines...) Expand all Loading... |
| 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.setInfo(SkImageInfo::MakeUnknown(fInfo.fSize.fWidth, fInfo.
fSize.fHeight)); |
| 45 fAccelData = accelData; | 45 fAccelData = accelData; |
| 46 fAlreadyDrawn = false; | 46 fAlreadyDrawn = false; |
| 47 } | 47 } |
| 48 | 48 |
| 49 virtual ~GrGatherDevice() { } | 49 virtual ~GrGatherDevice() { } |
| 50 | 50 |
| 51 virtual int width() const SK_OVERRIDE { return fInfo.fSize.width(); } | |
| 52 virtual int height() const SK_OVERRIDE { return fInfo.fSize.height(); } | |
| 53 virtual bool isOpaque() const SK_OVERRIDE { return false; } | |
| 54 virtual SkImageInfo imageInfo() const SK_OVERRIDE { | 51 virtual SkImageInfo imageInfo() const SK_OVERRIDE { |
| 55 return fEmptyBitmap.info(); | 52 return fEmptyBitmap.info(); |
| 56 } | 53 } |
| 57 | 54 |
| 58 #ifdef SK_SUPPORT_LEGACY_WRITEPIXELSCONFIG | 55 #ifdef SK_SUPPORT_LEGACY_WRITEPIXELSCONFIG |
| 59 virtual void writePixels(const SkBitmap& bitmap, int x, int y, | 56 virtual void writePixels(const SkBitmap& bitmap, int x, int y, |
| 60 SkCanvas::Config8888 config8888) SK_OVERRIDE { | 57 SkCanvas::Config8888 config8888) SK_OVERRIDE { |
| 61 NotSupported(); | 58 NotSupported(); |
| 62 } | 59 } |
| 63 #endif | 60 #endif |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 void GatherGPUInfo(const SkPicture* pict, GPUAccelData* accelData) { | 270 void GatherGPUInfo(const SkPicture* pict, GPUAccelData* accelData) { |
| 274 if (0 == pict->width() || 0 == pict->height()) { | 271 if (0 == pict->width() || 0 == pict->height()) { |
| 275 return ; | 272 return ; |
| 276 } | 273 } |
| 277 | 274 |
| 278 GrGatherDevice device(pict->width(), pict->height(), pict, accelData, 0); | 275 GrGatherDevice device(pict->width(), pict->height(), pict, accelData, 0); |
| 279 GrGatherCanvas canvas(&device, pict); | 276 GrGatherCanvas canvas(&device, pict); |
| 280 | 277 |
| 281 canvas.gather(); | 278 canvas.gather(); |
| 282 } | 279 } |
| OLD | NEW |