Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: Source/platform/graphics/GraphicsLayer.cpp

Issue 1299323005: blink: Add backdrop-filter support (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: one more Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 void GraphicsLayer::setFilters(const FilterOperations& filters) 1050 void GraphicsLayer::setFilters(const FilterOperations& filters)
1051 { 1051 {
1052 SkiaImageFilterBuilder builder; 1052 SkiaImageFilterBuilder builder;
1053 OwnPtr<WebFilterOperations> webFilters = adoptPtr(Platform::current()->compo sitorSupport()->createFilterOperations()); 1053 OwnPtr<WebFilterOperations> webFilters = adoptPtr(Platform::current()->compo sitorSupport()->createFilterOperations());
1054 FilterOutsets outsets = filters.outsets(); 1054 FilterOutsets outsets = filters.outsets();
1055 builder.setCropOffset(FloatSize(outsets.left(), outsets.top())); 1055 builder.setCropOffset(FloatSize(outsets.left(), outsets.top()));
1056 builder.buildFilterOperations(filters, webFilters.get()); 1056 builder.buildFilterOperations(filters, webFilters.get());
1057 m_layer->layer()->setFilters(*webFilters); 1057 m_layer->layer()->setFilters(*webFilters);
1058 } 1058 }
1059 1059
1060 void GraphicsLayer::setBackdropFilters(const FilterOperations& filters)
1061 {
1062 SkiaImageFilterBuilder builder;
1063 OwnPtr<WebFilterOperations> webFilters = adoptPtr(Platform::current()->compo sitorSupport()->createFilterOperations());
1064 FilterOutsets outsets = filters.outsets();
1065 builder.setCropOffset(FloatSize(outsets.left(), outsets.top()));
1066 builder.buildFilterOperations(filters, webFilters.get());
1067 m_layer->layer()->setBackgroundFilters(*webFilters);
1068 }
1069
1060 void GraphicsLayer::setFilterQuality(SkFilterQuality filterQuality) 1070 void GraphicsLayer::setFilterQuality(SkFilterQuality filterQuality)
1061 { 1071 {
1062 if (m_imageLayer) 1072 if (m_imageLayer)
1063 m_imageLayer->setNearestNeighbor(filterQuality == kNone_SkFilterQuality) ; 1073 m_imageLayer->setNearestNeighbor(filterQuality == kNone_SkFilterQuality) ;
1064 } 1074 }
1065 1075
1066 void GraphicsLayer::setPaintingPhase(GraphicsLayerPaintingPhase phase) 1076 void GraphicsLayer::setPaintingPhase(GraphicsLayerPaintingPhase phase)
1067 { 1077 {
1068 if (m_paintingPhase == phase) 1078 if (m_paintingPhase == phase)
1069 return; 1079 return;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 { 1155 {
1146 if (!layer) { 1156 if (!layer) {
1147 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); 1157 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n");
1148 return; 1158 return;
1149 } 1159 }
1150 1160
1151 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); 1161 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo);
1152 fprintf(stderr, "%s\n", output.utf8().data()); 1162 fprintf(stderr, "%s\n", output.utf8().data());
1153 } 1163 }
1154 #endif 1164 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698