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

Unified Diff: ppapi/shared_impl/ppb_graphics_3d_shared.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/shared_impl/ppb_graphics_3d_shared.h ('k') | ppapi/thunk/ppb_graphics_3d_api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/ppb_graphics_3d_shared.cc
diff --git a/ppapi/shared_impl/ppb_graphics_3d_shared.cc b/ppapi/shared_impl/ppb_graphics_3d_shared.cc
index 0c40b4cb53c53e589745ca1a12ef9fe2c566778a..4d3a4b0672df1a6585e7964196ddd7398d626d57 100644
--- a/ppapi/shared_impl/ppb_graphics_3d_shared.cc
+++ b/ppapi/shared_impl/ppb_graphics_3d_shared.cc
@@ -17,8 +17,9 @@ namespace ppapi {
PPB_Graphics3D_Shared::PPB_Graphics3D_Shared(PP_Instance instance)
: Resource(OBJECT_IS_IMPL, instance) {}
-PPB_Graphics3D_Shared::PPB_Graphics3D_Shared(const HostResource& host_resource)
- : Resource(OBJECT_IS_PROXY, host_resource) {}
+PPB_Graphics3D_Shared::PPB_Graphics3D_Shared(const HostResource& host_resource,
+ const gfx::Size& size)
+ : Resource(OBJECT_IS_PROXY, host_resource), size_(size) {}
PPB_Graphics3D_Shared::~PPB_Graphics3D_Shared() {
// Make sure that GLES2 implementation has already been destroyed.
@@ -51,22 +52,20 @@ int32_t PPB_Graphics3D_Shared::ResizeBuffers(int32_t width, int32_t height) {
return PP_ERROR_BADARGUMENT;
gles2_impl()->ResizeCHROMIUM(width, height, 1.f, true);
- width_ = width;
- height_ = height;
+ size_ = gfx::Size(width, height);
// TODO(alokp): Check if resize succeeded and return appropriate error code.
return PP_OK;
}
int32_t PPB_Graphics3D_Shared::SwapBuffers(
scoped_refptr<TrackedCallback> callback) {
- return SwapBuffersWithSyncToken(callback, gpu::SyncToken(), width_, height_);
+ return SwapBuffersWithSyncToken(callback, gpu::SyncToken(), size_);
}
int32_t PPB_Graphics3D_Shared::SwapBuffersWithSyncToken(
scoped_refptr<TrackedCallback> callback,
const gpu::SyncToken& sync_token,
- int32_t width,
- int32_t height) {
+ const gfx::Size& size) {
if (HasPendingSwap()) {
Log(PP_LOGLEVEL_ERROR,
"PPB_Graphics3D.SwapBuffers: Plugin attempted swap "
@@ -76,7 +75,7 @@ int32_t PPB_Graphics3D_Shared::SwapBuffersWithSyncToken(
}
swap_callback_ = callback;
- return DoSwapBuffers(sync_token, width, height);
+ return DoSwapBuffers(sync_token, size);
}
int32_t PPB_Graphics3D_Shared::GetAttribMaxValue(int32_t attribute,
« no previous file with comments | « ppapi/shared_impl/ppb_graphics_3d_shared.h ('k') | ppapi/thunk/ppb_graphics_3d_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698