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

Unified Diff: mojo/skia/ganesh_image_factory.cc

Issue 1776643004: Mozart: Specify texture origin explicitly. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-3
Patch Set: Created 4 years, 9 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 | « mojo/skia/ganesh_image_factory.h ('k') | mojo/ui/ganesh_renderer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/skia/ganesh_image_factory.cc
diff --git a/mojo/skia/ganesh_image_factory.cc b/mojo/skia/ganesh_image_factory.cc
index 5300d99f40ece51cdc93710fa03108093f08a36a..23d38ab0795e4d215f230ccad5cc8cd86d253af9 100644
--- a/mojo/skia/ganesh_image_factory.cc
+++ b/mojo/skia/ganesh_image_factory.cc
@@ -29,6 +29,7 @@ void ReleaseThunk(void* data) {
uint32_t texture_id,
uint32_t width,
uint32_t height,
+ GrSurfaceOrigin origin,
const base::Closure& release_callback) {
DCHECK(texture_id);
DCHECK(width);
@@ -44,7 +45,7 @@ void ReleaseThunk(void* data) {
desc.fWidth = width;
desc.fHeight = height;
desc.fConfig = kSkia8888_GrPixelConfig;
- desc.fOrigin = kTopLeft_GrSurfaceOrigin;
+ desc.fOrigin = origin;
desc.fTextureHandle = reinterpret_cast<GrBackendObject>(&info);
return ::skia::AdoptRef(SkImage::NewFromTexture(
scope.gr_context(), desc, kPremul_SkAlphaType, &ReleaseThunk,
@@ -55,9 +56,11 @@ MailboxTextureImageGenerator::MailboxTextureImageGenerator(
const GLbyte mailbox_name[GL_MAILBOX_SIZE_CHROMIUM],
GLuint sync_point,
uint32_t width,
- uint32_t height)
+ uint32_t height,
+ GrSurfaceOrigin origin)
: SkImageGenerator(SkImageInfo::MakeN32Premul(width, height)),
- sync_point_(sync_point) {
+ sync_point_(sync_point),
+ origin_(origin) {
DCHECK(mailbox_name);
memcpy(mailbox_name_, mailbox_name, GL_MAILBOX_SIZE_CHROMIUM);
}
@@ -85,7 +88,7 @@ GrTexture* MailboxTextureImageGenerator::onGenerateTexture(
desc.fWidth = getInfo().width();
desc.fHeight = getInfo().height();
desc.fConfig = kSkia8888_GrPixelConfig;
- desc.fOrigin = kTopLeft_GrSurfaceOrigin;
+ desc.fOrigin = origin_;
desc.fTextureHandle = reinterpret_cast<GrBackendObject>(&info);
return context->textureProvider()->wrapBackendTexture(desc,
kAdopt_GrWrapOwnership);
« no previous file with comments | « mojo/skia/ganesh_image_factory.h ('k') | mojo/ui/ganesh_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698