OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1135 | 1135 |
1136 WebLayer* GraphicsLayer::platformLayer() const | 1136 WebLayer* GraphicsLayer::platformLayer() const |
1137 { | 1137 { |
1138 return m_layer->layer(); | 1138 return m_layer->layer(); |
1139 } | 1139 } |
1140 | 1140 |
1141 void GraphicsLayer::setFilters(const FilterOperations& filters) | 1141 void GraphicsLayer::setFilters(const FilterOperations& filters) |
1142 { | 1142 { |
1143 SkiaImageFilterBuilder builder; | 1143 SkiaImageFilterBuilder builder; |
1144 OwnPtr<WebFilterOperations> webFilters = adoptPtr(Platform::current()->compo
sitorSupport()->createFilterOperations()); | 1144 OwnPtr<WebFilterOperations> webFilters = adoptPtr(Platform::current()->compo
sitorSupport()->createFilterOperations()); |
1145 FilterOutsets outsets = filters.outsets(); | |
1146 builder.setCropOffset(FloatSize(outsets.left(), outsets.top())); | |
1147 builder.buildFilterOperations(filters, webFilters.get()); | 1145 builder.buildFilterOperations(filters, webFilters.get()); |
1148 m_layer->layer()->setFilters(*webFilters); | 1146 m_layer->layer()->setFilters(*webFilters); |
1149 } | 1147 } |
1150 | 1148 |
1151 void GraphicsLayer::setBackdropFilters(const FilterOperations& filters) | 1149 void GraphicsLayer::setBackdropFilters(const FilterOperations& filters) |
1152 { | 1150 { |
1153 SkiaImageFilterBuilder builder; | 1151 SkiaImageFilterBuilder builder; |
1154 OwnPtr<WebFilterOperations> webFilters = adoptPtr(Platform::current()->compo
sitorSupport()->createFilterOperations()); | 1152 OwnPtr<WebFilterOperations> webFilters = adoptPtr(Platform::current()->compo
sitorSupport()->createFilterOperations()); |
1155 FilterOutsets outsets = filters.outsets(); | |
1156 builder.setCropOffset(FloatSize(outsets.left(), outsets.top())); | |
1157 builder.buildFilterOperations(filters, webFilters.get()); | 1153 builder.buildFilterOperations(filters, webFilters.get()); |
1158 m_layer->layer()->setBackgroundFilters(*webFilters); | 1154 m_layer->layer()->setBackgroundFilters(*webFilters); |
1159 } | 1155 } |
1160 | 1156 |
1161 void GraphicsLayer::setFilterQuality(SkFilterQuality filterQuality) | 1157 void GraphicsLayer::setFilterQuality(SkFilterQuality filterQuality) |
1162 { | 1158 { |
1163 if (m_imageLayer) | 1159 if (m_imageLayer) |
1164 m_imageLayer->setNearestNeighbor(filterQuality == kNone_SkFilterQuality)
; | 1160 m_imageLayer->setNearestNeighbor(filterQuality == kNone_SkFilterQuality)
; |
1165 } | 1161 } |
1166 | 1162 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1264 { | 1260 { |
1265 if (!layer) { | 1261 if (!layer) { |
1266 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); | 1262 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); |
1267 return; | 1263 return; |
1268 } | 1264 } |
1269 | 1265 |
1270 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); | 1266 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); |
1271 fprintf(stderr, "%s\n", output.utf8().data()); | 1267 fprintf(stderr, "%s\n", output.utf8().data()); |
1272 } | 1268 } |
1273 #endif | 1269 #endif |
OLD | NEW |