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

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

Issue 2164363002: Add SkColorSpace to GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove ':' from comment 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/SkImageFilter.cpp ('k') | src/core/SkSpecialSurface.h » ('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 "SkSpecialImage.h" 8 #include "SkSpecialImage.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkImage.h" 10 #include "SkImage.h"
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 384
385 sk_sp<SkSpecialSurface> onMakeSurface(const SkImageInfo& info) const overrid e { 385 sk_sp<SkSpecialSurface> onMakeSurface(const SkImageInfo& info) const overrid e {
386 if (!fTexture->getContext()) { 386 if (!fTexture->getContext()) {
387 return nullptr; 387 return nullptr;
388 } 388 }
389 389
390 GrPixelConfig config = SkImageInfo2GrPixelConfig(info, *fTexture->getCon text()->caps()); 390 GrPixelConfig config = SkImageInfo2GrPixelConfig(info, *fTexture->getCon text()->caps());
391 391
392 return SkSpecialSurface::MakeRenderTarget(fTexture->getContext(), 392 return SkSpecialSurface::MakeRenderTarget(fTexture->getContext(),
393 info.width(), info.height(), 393 info.width(), info.height(),
394 config); 394 config, sk_ref_sp(info.colorSp ace()));
395 } 395 }
396 396
397 sk_sp<SkSpecialImage> onMakeSubset(const SkIRect& subset) const override { 397 sk_sp<SkSpecialImage> onMakeSubset(const SkIRect& subset) const override {
398 return SkSpecialImage::MakeFromGpu(subset, 398 return SkSpecialImage::MakeFromGpu(subset,
399 this->uniqueID(), 399 this->uniqueID(),
400 fTexture, 400 fTexture,
401 fColorSpace, 401 fColorSpace,
402 &this->props(), 402 &this->props(),
403 fAlphaType); 403 fAlphaType);
404 } 404 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 sk_sp<GrTexture> tex, 446 sk_sp<GrTexture> tex,
447 sk_sp<SkColorSpace> colorSpace , 447 sk_sp<SkColorSpace> colorSpace ,
448 const SkSurfaceProps* props, 448 const SkSurfaceProps* props,
449 SkAlphaType at) { 449 SkAlphaType at) {
450 SkASSERT(rect_fits(subset, tex->width(), tex->height())); 450 SkASSERT(rect_fits(subset, tex->width(), tex->height()));
451 return sk_make_sp<SkSpecialImage_Gpu>(subset, uniqueID, std::move(tex), at, 451 return sk_make_sp<SkSpecialImage_Gpu>(subset, uniqueID, std::move(tex), at,
452 std::move(colorSpace), props); 452 std::move(colorSpace), props);
453 } 453 }
454 454
455 #endif 455 #endif
OLDNEW
« no previous file with comments | « src/core/SkImageFilter.cpp ('k') | src/core/SkSpecialSurface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698