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

Side by Side Diff: src/core/SkLightingShader.cpp

Issue 2225093002: Fixed comment about SkLightingShader::Context memory handling (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | no next file » | 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 2015 Google Inc. 2 * Copyright 2015 Google Inc.
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 "SkBitmapProcShader.h" 8 #include "SkBitmapProcShader.h"
9 #include "SkBitmapProcState.h" 9 #include "SkBitmapProcState.h"
10 #include "SkColor.h" 10 #include "SkColor.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 , fLights(std::move(lights)) {} 51 , fLights(std::move(lights)) {}
52 52
53 bool isOpaque() const override; 53 bool isOpaque() const override;
54 54
55 #if SK_SUPPORT_GPU 55 #if SK_SUPPORT_GPU
56 sk_sp<GrFragmentProcessor> asFragmentProcessor(const AsFPArgs&) const overri de; 56 sk_sp<GrFragmentProcessor> asFragmentProcessor(const AsFPArgs&) const overri de;
57 #endif 57 #endif
58 58
59 class LightingShaderContext : public SkShader::Context { 59 class LightingShaderContext : public SkShader::Context {
60 public: 60 public:
61 // The context takes ownership of the states. It will call their destruc tors 61 // The context takes ownership of the context and provider. It will call their destructors
62 // but will NOT free the memory. 62 // and then indirectly free their memory by calling free() on heapAlloca ted
63 LightingShaderContext(const SkLightingShaderImpl&, const ContextRec&, 63 LightingShaderContext(const SkLightingShaderImpl&, const ContextRec&,
64 SkShader::Context* diffuseContext, SkNormalSource: :Provider*, 64 SkShader::Context* diffuseContext, SkNormalSource: :Provider*,
65 void* heapAllocated); 65 void* heapAllocated);
66 66
67 ~LightingShaderContext() override; 67 ~LightingShaderContext() override;
68 68
69 void shadeSpan(int x, int y, SkPMColor[], int count) override; 69 void shadeSpan(int x, int y, SkPMColor[], int count) override;
70 70
71 uint32_t getFlags() const override { return fFlags; } 71 uint32_t getFlags() const override { return fFlags; }
72 72
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 std::move(lights)); 524 std::move(lights));
525 } 525 }
526 526
527 /////////////////////////////////////////////////////////////////////////////// 527 ///////////////////////////////////////////////////////////////////////////////
528 528
529 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingShader) 529 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkLightingShader)
530 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLightingShaderImpl) 530 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLightingShaderImpl)
531 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 531 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
532 532
533 /////////////////////////////////////////////////////////////////////////////// 533 ///////////////////////////////////////////////////////////////////////////////
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698