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

Side by Side Diff: src/effects/SkLightingImageFilter.cpp

Issue 143073008: add installPixels (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 6 years, 11 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
« no previous file with comments | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkPerlinNoiseShader.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The Android Open Source Project 2 * Copyright 2012 The Android Open Source Project
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 "SkLightingImageFilter.h" 8 #include "SkLightingImageFilter.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 bounds.offset(srcOffset); 945 bounds.offset(srcOffset);
946 if (!this->applyCropRect(&bounds, ctm)) { 946 if (!this->applyCropRect(&bounds, ctm)) {
947 return false; 947 return false;
948 } 948 }
949 949
950 if (bounds.width() < 2 || bounds.height() < 2) { 950 if (bounds.width() < 2 || bounds.height() < 2) {
951 return false; 951 return false;
952 } 952 }
953 953
954 dst->setConfig(src.config(), bounds.width(), bounds.height()); 954 dst->setConfig(src.config(), bounds.width(), bounds.height());
955 dst->allocPixels(); 955 if (!dst->allocPixels()) {
956 if (!dst->getPixels()) {
957 return false; 956 return false;
958 } 957 }
959 958
960 SkAutoTUnref<SkLight> transformedLight(light()->transform(ctm)); 959 SkAutoTUnref<SkLight> transformedLight(light()->transform(ctm));
961 960
962 DiffuseLightingType lightingType(fKD); 961 DiffuseLightingType lightingType(fKD);
963 offset->fX = bounds.left(); 962 offset->fX = bounds.left();
964 offset->fY = bounds.top(); 963 offset->fY = bounds.top();
965 bounds.offset(-srcOffset); 964 bounds.offset(-srcOffset);
966 switch (transformedLight->type()) { 965 switch (transformedLight->type()) {
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
1608 1607
1609 builder->fsCodeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); 1608 builder->fsCodeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight);
1610 } 1609 }
1611 1610
1612 #endif 1611 #endif
1613 1612
1614 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) 1613 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter)
1615 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) 1614 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter)
1616 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) 1615 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter)
1617 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1616 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « src/effects/SkDisplacementMapEffect.cpp ('k') | src/effects/SkPerlinNoiseShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698