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

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

Issue 22794007: Implement filter primitive subregion on accelerated reference filters (FEColorMatrix a… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix computation of default filter primitive subregion Created 7 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 | Annotate | Revision Log
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 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after
1246 // WebFilterOperations altogether. 1246 // WebFilterOperations altogether.
1247 if (filters.hasReferenceFilter()) { 1247 if (filters.hasReferenceFilter()) {
1248 if (filters.hasCustomFilter()) { 1248 if (filters.hasCustomFilter()) {
1249 // Make sure the filters are removed from the platform layer, as the y are 1249 // Make sure the filters are removed from the platform layer, as the y are
1250 // going to fallback to software mode. 1250 // going to fallback to software mode.
1251 m_layer->layer()->setFilter(0); 1251 m_layer->layer()->setFilter(0);
1252 m_filters = FilterOperations(); 1252 m_filters = FilterOperations();
1253 return false; 1253 return false;
1254 } 1254 }
1255 SkiaImageFilterBuilder builder; 1255 SkiaImageFilterBuilder builder;
1256 FilterOutsets outsets = filters.outsets();
1257 builder.setCropOffset(FloatSize(outsets.left(), outsets.top()));
1256 RefPtr<SkImageFilter> imageFilter = builder.build(filters); 1258 RefPtr<SkImageFilter> imageFilter = builder.build(filters);
1257 m_layer->layer()->setFilter(imageFilter.get()); 1259 m_layer->layer()->setFilter(imageFilter.get());
1258 } else { 1260 } else {
1259 OwnPtr<WebFilterOperations> webFilters = adoptPtr(Platform::current()->c ompositorSupport()->createFilterOperations()); 1261 OwnPtr<WebFilterOperations> webFilters = adoptPtr(Platform::current()->c ompositorSupport()->createFilterOperations());
1260 if (!copyWebCoreFilterOperationsToWebFilterOperations(filters, *webFilte rs)) { 1262 if (!copyWebCoreFilterOperationsToWebFilterOperations(filters, *webFilte rs)) {
1261 // Make sure the filters are removed from the platform layer, as the y are 1263 // Make sure the filters are removed from the platform layer, as the y are
1262 // going to fallback to software mode. 1264 // going to fallback to software mode.
1263 webFilters->clear(); 1265 webFilters->clear();
1264 m_layer->layer()->setFilters(*webFilters); 1266 m_layer->layer()->setFilters(*webFilters);
1265 m_filters = FilterOperations(); 1267 m_filters = FilterOperations();
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1331 #ifndef NDEBUG 1333 #ifndef NDEBUG
1332 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer) 1334 void showGraphicsLayerTree(const WebCore::GraphicsLayer* layer)
1333 { 1335 {
1334 if (!layer) 1336 if (!layer)
1335 return; 1337 return;
1336 1338
1337 String output = layer->layerTreeAsText(WebCore::LayerTreeIncludesDebugInfo); 1339 String output = layer->layerTreeAsText(WebCore::LayerTreeIncludesDebugInfo);
1338 fprintf(stderr, "%s\n", output.utf8().data()); 1340 fprintf(stderr, "%s\n", output.utf8().data());
1339 } 1341 }
1340 #endif 1342 #endif
OLDNEW
« no previous file with comments | « LayoutTests/css3/filters/effect-reference-subregion-hw.html ('k') | Source/core/platform/graphics/filters/FEColorMatrix.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698