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

Unified Diff: ppapi/proxy/ppb_graphics_3d_proxy.cc

Issue 2136743002: Simplify ppapi Graphics3D size propagation a bit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_attr_parse_to_pepper
Patch Set: fix win64+gyp build 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 | « ppapi/proxy/ppb_graphics_3d_proxy.h ('k') | ppapi/proxy/video_decoder_resource_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_graphics_3d_proxy.cc
diff --git a/ppapi/proxy/ppb_graphics_3d_proxy.cc b/ppapi/proxy/ppb_graphics_3d_proxy.cc
index ac08224b5063d8f18578ac41367fdd56b7fc3fa7..7725330b63b94c54da55a73feead4e46b636d1f2 100644
--- a/ppapi/proxy/ppb_graphics_3d_proxy.cc
+++ b/ppapi/proxy/ppb_graphics_3d_proxy.cc
@@ -48,8 +48,8 @@ gpu::CommandBuffer::State GetErrorState() {
} // namespace
-Graphics3D::Graphics3D(const HostResource& resource)
- : PPB_Graphics3D_Shared(resource) {
+Graphics3D::Graphics3D(const HostResource& resource, const gfx::Size& size)
+ : PPB_Graphics3D_Shared(resource, size) {
}
Graphics3D::~Graphics3D() {
@@ -118,8 +118,7 @@ gpu::GpuControl* Graphics3D::GetGpuControl() {
}
int32_t Graphics3D::DoSwapBuffers(const gpu::SyncToken& sync_token,
- int32_t width,
- int32_t height) {
+ const gfx::Size& size) {
// A valid sync token would indicate a swap buffer already happened somehow.
DCHECK(!sync_token.HasData());
@@ -137,8 +136,7 @@ int32_t Graphics3D::DoSwapBuffers(const gpu::SyncToken& sync_token,
gl->GenSyncTokenCHROMIUM(fence_sync, new_sync_token.GetData());
IPC::Message* msg = new PpapiHostMsg_PPBGraphics3D_SwapBuffers(
- API_ID_PPB_GRAPHICS_3D, host_resource(), new_sync_token, width,
- height);
+ API_ID_PPB_GRAPHICS_3D, host_resource(), new_sync_token, size);
msg->set_unblock(true);
PluginDispatcher::GetForResource(this)->Send(msg);
@@ -215,7 +213,8 @@ PP_Resource PPB_Graphics3D_Proxy::CreateProxyResource(
if (result.is_null())
return 0;
- scoped_refptr<Graphics3D> graphics_3d(new Graphics3D(result));
+ scoped_refptr<Graphics3D> graphics_3d(
+ new Graphics3D(result, attrib_helper.offscreen_framebuffer_size));
if (!graphics_3d->Init(share_gles2, capabilities, shared_state,
command_buffer_id)) {
return 0;
@@ -361,14 +360,13 @@ void PPB_Graphics3D_Proxy::OnMsgDestroyTransferBuffer(
void PPB_Graphics3D_Proxy::OnMsgSwapBuffers(const HostResource& context,
const gpu::SyncToken& sync_token,
- int32_t width,
- int32_t height) {
+ const gfx::Size& size) {
EnterHostFromHostResourceForceCallback<PPB_Graphics3D_API> enter(
context, callback_factory_,
&PPB_Graphics3D_Proxy::SendSwapBuffersACKToPlugin, context);
if (enter.succeeded())
enter.SetResult(enter.object()->SwapBuffersWithSyncToken(
- enter.callback(), sync_token, width, height));
+ enter.callback(), sync_token, size));
}
void PPB_Graphics3D_Proxy::OnMsgTakeFrontBuffer(const HostResource& context) {
« no previous file with comments | « ppapi/proxy/ppb_graphics_3d_proxy.h ('k') | ppapi/proxy/video_decoder_resource_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698