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

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

Issue 2358433004: Cleanup some sRGB TODOs, mostly around setting GrPaint flags correctly (Closed)
Patch Set: Created 4 years, 2 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 | « gm/constcolorprocessor.cpp ('k') | src/effects/SkLightingImageFilter.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 2016 Google Inc. 2 * Copyright 2016 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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkSpecialImage.h" 9 #include "SkSpecialImage.h"
10 #include "SkSpecialSurface.h" 10 #include "SkSpecialSurface.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 fCanvas.reset(new SkCanvas(device.get())); 130 fCanvas.reset(new SkCanvas(device.get()));
131 fCanvas->clipRect(SkRect::Make(subset)); 131 fCanvas->clipRect(SkRect::Make(subset));
132 #ifdef SK_IS_BOT 132 #ifdef SK_IS_BOT
133 fCanvas->clear(SK_ColorRED); // catch any imageFilter sloppiness 133 fCanvas->clear(SK_ColorRED); // catch any imageFilter sloppiness
134 #endif 134 #endif
135 } 135 }
136 136
137 ~SkSpecialSurface_Gpu() override { } 137 ~SkSpecialSurface_Gpu() override { }
138 138
139 sk_sp<SkSpecialImage> onMakeImageSnapshot() override { 139 sk_sp<SkSpecialImage> onMakeImageSnapshot() override {
140 // TODO: Supply color space from fDrawContext, once it's present 140 sk_sp<SkSpecialImage> tmp(SkSpecialImage::MakeFromGpu(
141 sk_sp<SkSpecialImage> tmp(SkSpecialImage::MakeFromGpu(this->subset(), 141 this->subset(),
142 kNeedNewImageUniqu eID_SpecialImage, 142 kNeedNewImageUniqueID _SpecialImage,
143 fDrawContext->asTe xture(), 143 fDrawContext->asTextu re(),
144 nullptr, 144 sk_ref_sp(fDrawContex t->getColorSpace()),
145 &this->props())); 145 &this->props()));
146 fDrawContext = nullptr; 146 fDrawContext = nullptr;
147 return tmp; 147 return tmp;
148 } 148 }
149 149
150 private: 150 private:
151 sk_sp<GrDrawContext> fDrawContext; 151 sk_sp<GrDrawContext> fDrawContext;
152 152
153 typedef SkSpecialSurface_Base INHERITED; 153 typedef SkSpecialSurface_Base INHERITED;
154 }; 154 };
155 155
(...skipping 11 matching lines...) Expand all
167 if (!drawContext) { 167 if (!drawContext) {
168 return nullptr; 168 return nullptr;
169 } 169 }
170 170
171 const SkIRect subset = SkIRect::MakeWH(width, height); 171 const SkIRect subset = SkIRect::MakeWH(width, height);
172 172
173 return sk_make_sp<SkSpecialSurface_Gpu>(std::move(drawContext), width, heigh t, subset); 173 return sk_make_sp<SkSpecialSurface_Gpu>(std::move(drawContext), width, heigh t, subset);
174 } 174 }
175 175
176 #endif 176 #endif
OLDNEW
« no previous file with comments | « gm/constcolorprocessor.cpp ('k') | src/effects/SkLightingImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698