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

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

Issue 1845283003: Gamma-correctness pushed into Skia, top-down. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 8 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 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 fBitmap.setInfo(info, info.minRowBytes()); 76 fBitmap.setInfo(info, info.minRowBytes());
77 fBitmap.setPixelRef(pr); 77 fBitmap.setPixelRef(pr);
78 78
79 fCanvas.reset(new SkCanvas(fBitmap)); 79 fCanvas.reset(new SkCanvas(fBitmap));
80 } 80 }
81 81
82 ~SkSpecialSurface_Raster() override { } 82 ~SkSpecialSurface_Raster() override { }
83 83
84 sk_sp<SkSpecialImage> onMakeImageSnapshot() override { 84 sk_sp<SkSpecialImage> onMakeImageSnapshot() override {
85 return SkSpecialImage::MakeFromRaster(this->proxy(), this->subset(), fBi tmap); 85 return SkSpecialImage::MakeFromRaster(this->proxy(), this->subset(), fBi tmap,
86 &this->props());
86 } 87 }
87 88
88 private: 89 private:
89 SkBitmap fBitmap; 90 SkBitmap fBitmap;
90 91
91 typedef SkSpecialSurface_Base INHERITED; 92 typedef SkSpecialSurface_Base INHERITED;
92 }; 93 };
93 94
94 sk_sp<SkSpecialSurface> SkSpecialSurface::MakeFromBitmap(SkImageFilter::Proxy* p roxy, 95 sk_sp<SkSpecialSurface> SkSpecialSurface::MakeFromBitmap(SkImageFilter::Proxy* p roxy,
95 const SkIRect& subset, SkBitmap& bm, 96 const SkIRect& subset, SkBitmap& bm,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 return; 133 return;
133 } 134 }
134 135
135 fCanvas.reset(new SkCanvas(device)); 136 fCanvas.reset(new SkCanvas(device));
136 } 137 }
137 138
138 ~SkSpecialSurface_Gpu() override { } 139 ~SkSpecialSurface_Gpu() override { }
139 140
140 sk_sp<SkSpecialImage> onMakeImageSnapshot() override { 141 sk_sp<SkSpecialImage> onMakeImageSnapshot() override {
141 return SkSpecialImage::MakeFromGpu(this->proxy(), this->subset(), 142 return SkSpecialImage::MakeFromGpu(this->proxy(), this->subset(),
142 kNeedNewImageUniqueID_SpecialImage, f Texture); 143 kNeedNewImageUniqueID_SpecialImage, f Texture,
144 &this->props());
143 } 145 }
144 146
145 private: 147 private:
146 SkAutoTUnref<GrTexture> fTexture; 148 SkAutoTUnref<GrTexture> fTexture;
147 149
148 typedef SkSpecialSurface_Base INHERITED; 150 typedef SkSpecialSurface_Base INHERITED;
149 }; 151 };
150 152
151 sk_sp<SkSpecialSurface> SkSpecialSurface::MakeFromTexture(SkImageFilter::Proxy* proxy, 153 sk_sp<SkSpecialSurface> SkSpecialSurface::MakeFromTexture(SkImageFilter::Proxy* proxy,
152 const SkIRect& subset, 154 const SkIRect& subset,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 } 189 }
188 190
189 sk_sp<SkSpecialSurface> SkSpecialSurface::MakeRenderTarget(SkImageFilter::Proxy* proxy, 191 sk_sp<SkSpecialSurface> SkSpecialSurface::MakeRenderTarget(SkImageFilter::Proxy* proxy,
190 GrContext* context, 192 GrContext* context,
191 const GrSurfaceDesc& desc, 193 const GrSurfaceDesc& desc,
192 const SkSurfaceProps* props) { 194 const SkSurfaceProps* props) {
193 return nullptr; 195 return nullptr;
194 } 196 }
195 197
196 #endif 198 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698