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

Unified Diff: src/image/SkSurface_Gpu.cpp

Issue 2163323002: Add desired width & height to drawContext (as opposed to using the width & height of the RT) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More 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/gpu/SkGpuDevice.cpp ('k') | tests/RectangleTextureTest.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 5d1555f32364a04d3ea6223336dbd1d8bbbd955a..c5a8ffe23ee56512c8b17c92b7cee8c574c0a3c6 100644
--- a/src/image/SkSurface_Gpu.cpp
+++ b/src/image/SkSurface_Gpu.cpp
@@ -34,7 +34,7 @@ static GrRenderTarget* prepare_rt_for_external_access(SkSurface_Gpu* surface,
case SkSurface::kDiscardWrite_BackendHandleAccess:
// for now we don't special-case on Discard, but we may in the future.
surface->notifyContentWillChange(SkSurface::kRetain_ContentChangeMode);
- // legacy: need to dirty the bitmap's genID in our device (curse it)
+ // legacy: need to dirty the bitmap's genID in our device (curse it)
surface->getDevice()->accessBitmap(false).notifyPixelsChanged();
break;
}
@@ -135,7 +135,8 @@ void SkSurface_Gpu::onPrepareForExternalIO() {
sk_sp<SkSurface> SkSurface::MakeRenderTargetDirect(GrRenderTarget* target,
const SkSurfaceProps* props) {
sk_sp<SkGpuDevice> device(
- SkGpuDevice::Make(sk_ref_sp(target), props, SkGpuDevice::kUninit_InitContents));
+ SkGpuDevice::Make(target->width(), target->height(),
+ sk_ref_sp(target), props, SkGpuDevice::kUninit_InitContents));
if (!device) {
return nullptr;
}
@@ -167,7 +168,8 @@ sk_sp<SkSurface> SkSurface::MakeFromBackendTexture(GrContext* context,
if (!surface) {
return nullptr;
}
- sk_sp<SkGpuDevice> device(SkGpuDevice::Make(sk_ref_sp(surface->asRenderTarget()), props,
+ sk_sp<SkGpuDevice> device(SkGpuDevice::Make(desc.fWidth, desc.fHeight,
+ sk_ref_sp(surface->asRenderTarget()), props,
SkGpuDevice::kUninit_InitContents));
if (!device) {
return nullptr;
@@ -185,7 +187,8 @@ sk_sp<SkSurface> SkSurface::MakeFromBackendRenderTarget(GrContext* context,
if (!rt) {
return nullptr;
}
- sk_sp<SkGpuDevice> device(SkGpuDevice::Make(std::move(rt), props,
+ sk_sp<SkGpuDevice> device(SkGpuDevice::Make(desc.fWidth, desc.fHeight,
+ std::move(rt), props,
SkGpuDevice::kUninit_InitContents));
if (!device) {
return nullptr;
@@ -203,7 +206,8 @@ sk_sp<SkSurface> SkSurface::MakeFromBackendTextureAsRenderTarget(GrContext* cont
if (!rt) {
return nullptr;
}
- sk_sp<SkGpuDevice> device(SkGpuDevice::Make(std::move(rt), props,
+ sk_sp<SkGpuDevice> device(SkGpuDevice::Make(desc.fWidth, desc.fHeight,
+ std::move(rt), props,
SkGpuDevice::kUninit_InitContents));
if (!device) {
return nullptr;
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | tests/RectangleTextureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698