OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
978 ASSERT(!rect.isEmpty()); | 978 ASSERT(!rect.isEmpty()); |
979 if (rect.isEmpty()) | 979 if (rect.isEmpty()) |
980 return; | 980 return; |
981 | 981 |
982 SkRect skRect = rect; | 982 SkRect skRect = rect; |
983 int fillcolorNotTransparent = immutableState()->fillColor().rgb() & 0xFF0000
00; | 983 int fillcolorNotTransparent = immutableState()->fillColor().rgb() & 0xFF0000
00; |
984 if (fillcolorNotTransparent) | 984 if (fillcolorNotTransparent) |
985 drawRect(skRect, immutableState()->fillPaint()); | 985 drawRect(skRect, immutableState()->fillPaint()); |
986 | 986 |
987 if (immutableState()->strokeData().style() != NoStroke | 987 if (immutableState()->strokeData().style() != NoStroke |
988 && immutableState()->strokeData().color().alpha()) { | 988 && immutableState()->strokeColor().alpha()) { |
989 // Stroke a width: 1 inset border | 989 // Stroke a width: 1 inset border |
990 SkPaint paint(immutableState()->fillPaint()); | 990 SkPaint paint(immutableState()->fillPaint()); |
991 paint.setColor(effectiveStrokeColor()); | 991 paint.setColor(effectiveStrokeColor()); |
992 paint.setStyle(SkPaint::kStroke_Style); | 992 paint.setStyle(SkPaint::kStroke_Style); |
993 paint.setStrokeWidth(1); | 993 paint.setStrokeWidth(1); |
994 | 994 |
995 skRect.inset(0.5f, 0.5f); | 995 skRect.inset(0.5f, 0.5f); |
996 drawRect(skRect, paint); | 996 drawRect(skRect, paint); |
997 } | 997 } |
998 } | 998 } |
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2003 // FIXME: This is to not break tests (it results in the filter bitmap fl
ag | 2003 // FIXME: This is to not break tests (it results in the filter bitmap fl
ag |
2004 // being set to true). We need to decide if we respect InterpolationNone | 2004 // being set to true). We need to decide if we respect InterpolationNone |
2005 // being returned from computeInterpolationQuality. | 2005 // being returned from computeInterpolationQuality. |
2006 resampling = InterpolationLow; | 2006 resampling = InterpolationLow; |
2007 } | 2007 } |
2008 resampling = limitInterpolationQuality(this, resampling); | 2008 resampling = limitInterpolationQuality(this, resampling); |
2009 paint->setFilterLevel(static_cast<SkPaint::FilterLevel>(resampling)); | 2009 paint->setFilterLevel(static_cast<SkPaint::FilterLevel>(resampling)); |
2010 } | 2010 } |
2011 | 2011 |
2012 } // namespace blink | 2012 } // namespace blink |
OLD | NEW |