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

Unified Diff: src/image/SkSurface_Gpu.cpp

Issue 2187573002: Reduce usage of MakeRenderTargetDirect (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Clean up 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/image/SkSurface.cpp ('k') | tests/DeviceTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkSurface_Gpu.cpp
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
index ef8dd5f06e7196e2f41e5268461cb3959f07bf20..d8b4cee2dcc891510f3565715997d1f38040ff53 100644
--- a/src/image/SkSurface_Gpu.cpp
+++ b/src/image/SkSurface_Gpu.cpp
@@ -67,10 +67,11 @@ SkCanvas* SkSurface_Gpu::onNewCanvas() {
sk_sp<SkSurface> SkSurface_Gpu::onNewSurface(const SkImageInfo& info) {
int sampleCount = fDevice->accessDrawContext()->numColorSamples();
+ GrSurfaceOrigin origin = fDevice->accessDrawContext()->origin();
// TODO: Make caller specify this (change virtual signature of onNewSurface).
static const SkBudgeted kBudgeted = SkBudgeted::kNo;
return SkSurface::MakeRenderTarget(fDevice->context(), kBudgeted, info, sampleCount,
- &this->props());
+ origin, &this->props());
}
sk_sp<SkImage> SkSurface_Gpu::onNewImageSnapshot(SkBudgeted budgeted, ForceCopyMode forceCopyMode) {
@@ -145,9 +146,9 @@ sk_sp<SkSurface> SkSurface::MakeRenderTargetDirect(GrRenderTarget* target,
sk_sp<SkSurface> SkSurface::MakeRenderTarget(GrContext* ctx, SkBudgeted budgeted,
const SkImageInfo& info, int sampleCount,
- const SkSurfaceProps* props) {
+ GrSurfaceOrigin origin, const SkSurfaceProps* props) {
sk_sp<SkGpuDevice> device(SkGpuDevice::Make(
- ctx, budgeted, info, sampleCount, props, SkGpuDevice::kClear_InitContents));
+ ctx, budgeted, info, sampleCount, origin, props, SkGpuDevice::kClear_InitContents));
if (!device) {
return nullptr;
}
« no previous file with comments | « src/image/SkSurface.cpp ('k') | tests/DeviceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698