OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SkColorFilter.h" | 8 #include "SkColorFilter.h" |
9 #include "SkDevice.h" | 9 #include "SkDevice.h" |
10 #include "SkDraw.h" | 10 #include "SkDraw.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 SkBaseDevice::SkBaseDevice(const SkSurfaceProps& surfaceProps) | 23 SkBaseDevice::SkBaseDevice(const SkSurfaceProps& surfaceProps) |
24 : fSurfaceProps(surfaceProps) | 24 : fSurfaceProps(surfaceProps) |
25 #ifdef SK_DEBUG | 25 #ifdef SK_DEBUG |
26 , fAttachedToCanvas(false) | 26 , fAttachedToCanvas(false) |
27 #endif | 27 #endif |
28 { | 28 { |
29 fOrigin.setZero(); | 29 fOrigin.setZero(); |
30 fMetaData = NULL; | 30 fMetaData = NULL; |
31 } | 31 } |
32 | 32 |
33 SkBaseDevice::~SkBaseDevice() { | 33 SkBaseDevice::~SkBaseDevice() { delete fMetaData; } |
34 SkDELETE(fMetaData); | |
35 } | |
36 | 34 |
37 SkMetaData& SkBaseDevice::getMetaData() { | 35 SkMetaData& SkBaseDevice::getMetaData() { |
38 // metadata users are rare, so we lazily allocate it. If that changes we | 36 // metadata users are rare, so we lazily allocate it. If that changes we |
39 // can decide to just make it a field in the device (rather than a ptr) | 37 // can decide to just make it a field in the device (rather than a ptr) |
40 if (NULL == fMetaData) { | 38 if (NULL == fMetaData) { |
41 fMetaData = new SkMetaData; | 39 fMetaData = new SkMetaData; |
42 } | 40 } |
43 return *fMetaData; | 41 return *fMetaData; |
44 } | 42 } |
45 | 43 |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 if (kUnknown_SkPixelGeometry == fSurfaceProps.pixelGeometry() | 412 if (kUnknown_SkPixelGeometry == fSurfaceProps.pixelGeometry() |
415 || this->onShouldDisableLCD(paint)) { | 413 || this->onShouldDisableLCD(paint)) { |
416 | 414 |
417 flags &= ~SkPaint::kLCDRenderText_Flag; | 415 flags &= ~SkPaint::kLCDRenderText_Flag; |
418 flags |= SkPaint::kGenA8FromLCD_Flag; | 416 flags |= SkPaint::kGenA8FromLCD_Flag; |
419 } | 417 } |
420 | 418 |
421 return flags; | 419 return flags; |
422 } | 420 } |
423 | 421 |
OLD | NEW |