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 "SkDevice.h" | 8 #include "SkDevice.h" |
9 #include "SkDraw.h" | 9 #include "SkDraw.h" |
10 #include "SkDrawFilter.h" | 10 #include "SkDrawFilter.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 break; | 63 break; |
64 case kNever_TileUsage: | 64 case kNever_TileUsage: |
65 if (info.alphaType() != kOpaque_SkAlphaType) { | 65 if (info.alphaType() != kOpaque_SkAlphaType) { |
66 geo = kUnknown_SkPixelGeometry; | 66 geo = kUnknown_SkPixelGeometry; |
67 } | 67 } |
68 break; | 68 break; |
69 } | 69 } |
70 return geo; | 70 return geo; |
71 } | 71 } |
72 | 72 |
73 void SkBaseDevice::initForRootLayer(SkPixelGeometry geo) { | |
74 // For now we don't expect to change the geometry for the root-layer, but we
make the call | |
75 // anyway to document logically what is going on. | |
76 // | |
77 fSurfaceProps.setPixelGeometry_dont_use(CreateInfo::AdjustGeometry(this->ima
geInfo(), | |
78 kPossible
_TileUsage, | |
79 geo)); | |
80 } | |
81 | |
82 void SkBaseDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer, | 73 void SkBaseDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer, |
83 const SkRRect& inner, const SkPaint& paint) { | 74 const SkRRect& inner, const SkPaint& paint) { |
84 SkPath path; | 75 SkPath path; |
85 path.addRRect(outer); | 76 path.addRRect(outer); |
86 path.addRRect(inner); | 77 path.addRRect(inner); |
87 path.setFillType(SkPath::kEvenOdd_FillType); | 78 path.setFillType(SkPath::kEvenOdd_FillType); |
88 | 79 |
89 const SkMatrix* preMatrix = NULL; | 80 const SkMatrix* preMatrix = NULL; |
90 const bool pathIsMutable = true; | 81 const bool pathIsMutable = true; |
91 this->drawPath(draw, path, paint, preMatrix, pathIsMutable); | 82 this->drawPath(draw, path, paint, preMatrix, pathIsMutable); |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 if (kUnknown_SkPixelGeometry == fSurfaceProps.pixelGeometry() | 353 if (kUnknown_SkPixelGeometry == fSurfaceProps.pixelGeometry() |
363 || this->onShouldDisableLCD(paint)) { | 354 || this->onShouldDisableLCD(paint)) { |
364 | 355 |
365 flags &= ~SkPaint::kLCDRenderText_Flag; | 356 flags &= ~SkPaint::kLCDRenderText_Flag; |
366 flags |= SkPaint::kGenA8FromLCD_Flag; | 357 flags |= SkPaint::kGenA8FromLCD_Flag; |
367 } | 358 } |
368 | 359 |
369 return flags; | 360 return flags; |
370 } | 361 } |
371 | 362 |
OLD | NEW |