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

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

Issue 2163343002: Adding color space to SkSpecialImage (Closed) Base URL: https://skia.googlesource.com/skia.git@colorspace-on-image
Patch Set: Fix compile after rebase 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
« no previous file with comments | « src/core/SkSpecialImage.cpp ('k') | src/effects/SkAlphaThresholdFilter.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(this->subset(), 141 sk_sp<SkSpecialImage> tmp(SkSpecialImage::MakeFromGpu(this->subset(),
141 kNeedNewImageUniqu eID_SpecialImage, 142 kNeedNewImageUniqu eID_SpecialImage,
142 fDrawContext->asTe xture(), 143 fDrawContext->asTe xture(),
144 nullptr,
143 &this->props())); 145 &this->props()));
144 fDrawContext = nullptr; 146 fDrawContext = nullptr;
145 return tmp; 147 return tmp;
146 } 148 }
147 149
148 private: 150 private:
149 sk_sp<GrDrawContext> fDrawContext; 151 sk_sp<GrDrawContext> fDrawContext;
150 152
151 typedef SkSpecialSurface_Base INHERITED; 153 typedef SkSpecialSurface_Base INHERITED;
152 }; 154 };
(...skipping 10 matching lines...) Expand all
163 if (!drawContext) { 165 if (!drawContext) {
164 return nullptr; 166 return nullptr;
165 } 167 }
166 168
167 const SkIRect subset = SkIRect::MakeWH(width, height); 169 const SkIRect subset = SkIRect::MakeWH(width, height);
168 170
169 return sk_make_sp<SkSpecialSurface_Gpu>(std::move(drawContext), width, heigh t, subset); 171 return sk_make_sp<SkSpecialSurface_Gpu>(std::move(drawContext), width, heigh t, subset);
170 } 172 }
171 173
172 #endif 174 #endif
OLDNEW
« no previous file with comments | « src/core/SkSpecialImage.cpp ('k') | src/effects/SkAlphaThresholdFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698