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

Side by Side Diff: ppapi/cpp/graphics_2d.cc

Issue 6899055: PPAPI: Force async callback invocation option. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/cpp/file_system.cc ('k') | ppapi/cpp/paint_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/cpp/graphics_2d.h" 5 #include "ppapi/cpp/graphics_2d.h"
6 6
7 #include "ppapi/c/pp_errors.h" 7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/ppb_graphics_2d.h" 8 #include "ppapi/c/ppb_graphics_2d.h"
9 #include "ppapi/cpp/common.h" 9 #include "ppapi/cpp/common.h"
10 #include "ppapi/cpp/completion_callback.h" 10 #include "ppapi/cpp/completion_callback.h"
11 #include "ppapi/cpp/image_data.h" 11 #include "ppapi/cpp/image_data.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 get_interface<PPB_Graphics2D>()->ReplaceContents(pp_resource(), 93 get_interface<PPB_Graphics2D>()->ReplaceContents(pp_resource(),
94 image->pp_resource()); 94 image->pp_resource());
95 95
96 // On success, reset the image data. This is to help prevent people 96 // On success, reset the image data. This is to help prevent people
97 // from continuing to use the resource which will result in artifacts. 97 // from continuing to use the resource which will result in artifacts.
98 *image = ImageData(); 98 *image = ImageData();
99 } 99 }
100 100
101 int32_t Graphics2D::Flush(const CompletionCallback& cc) { 101 int32_t Graphics2D::Flush(const CompletionCallback& cc) {
102 if (!has_interface<PPB_Graphics2D>()) 102 if (!has_interface<PPB_Graphics2D>())
103 return PP_ERROR_NOINTERFACE; 103 return cc.MayForce(PP_ERROR_NOINTERFACE);
104 return get_interface<PPB_Graphics2D>()->Flush(pp_resource(), 104 return get_interface<PPB_Graphics2D>()->Flush(pp_resource(),
105 cc.pp_completion_callback()); 105 cc.pp_completion_callback());
106 } 106 }
107 107
108 } // namespace pp 108 } // namespace pp
OLDNEW
« no previous file with comments | « ppapi/cpp/file_system.cc ('k') | ppapi/cpp/paint_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698