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

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

Issue 2163343002: Adding color space to SkSpecialImage (Closed) Base URL: https://skia.googlesource.com/skia.git@colorspace-on-image
Patch Set: Created 4 years, 5 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 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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, interior , 445 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, interior ,
446 kInterior_BoundaryMode, pSrcBounds, offsetBounds); 446 kInterior_BoundaryMode, pSrcBounds, offsetBounds);
447 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, right, k Right_BoundaryMode, 447 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, right, k Right_BoundaryMode,
448 pSrcBounds, offsetBounds); 448 pSrcBounds, offsetBounds);
449 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, bottomLe ft, 449 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, bottomLe ft,
450 kBottomLeft_BoundaryMode, pSrcBounds, offsetBounds); 450 kBottomLeft_BoundaryMode, pSrcBounds, offsetBounds);
451 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, bottom, 451 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, bottom,
452 kBottom_BoundaryMode, pSrcBounds, offsetBounds); 452 kBottom_BoundaryMode, pSrcBounds, offsetBounds);
453 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, bottomRi ght, 453 this->drawRect(drawContext.get(), inputTexture.get(), matrix, clip, bottomRi ght,
454 kBottomRight_BoundaryMode, pSrcBounds, offsetBounds); 454 kBottomRight_BoundaryMode, pSrcBounds, offsetBounds);
455 455
robertphillips 2016/07/20 19:44:39 // TODO: ...
456 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(offsetBounds.width(), off setBounds.height()), 456 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(offsetBounds.width(), off setBounds.height()),
457 kNeedNewImageUniqueID_SpecialImage, 457 kNeedNewImageUniqueID_SpecialImage,
458 drawContext->asTexture()); 458 drawContext->asTexture(),
459 sk_ref_sp(source->getColorSpace()));
459 } 460 }
460 #endif 461 #endif
461 462
462 class SkDiffuseLightingImageFilter : public SkLightingImageFilterInternal { 463 class SkDiffuseLightingImageFilter : public SkLightingImageFilterInternal {
463 public: 464 public:
464 static sk_sp<SkImageFilter> Make(sk_sp<SkImageFilterLight> light, 465 static sk_sp<SkImageFilter> Make(sk_sp<SkImageFilterLight> light,
465 SkScalar surfaceScale, 466 SkScalar surfaceScale,
466 SkScalar kd, 467 SkScalar kd,
467 sk_sp<SkImageFilter>, 468 sk_sp<SkImageFilter>,
468 const CropRect*); 469 const CropRect*);
(...skipping 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after
2168 2169
2169 fragBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight); 2170 fragBuilder->codeAppendf("%s(%s)", fLightColorFunc.c_str(), surfaceToLight);
2170 } 2171 }
2171 2172
2172 #endif 2173 #endif
2173 2174
2174 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter) 2175 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingImageFilter)
2175 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter) 2176 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiffuseLightingImageFilter)
2176 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter) 2177 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSpecularLightingImageFilter)
2177 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 2178 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698