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

Side by Side Diff: ppapi/thunk/ppb_graphics_2d_api.h

Issue 10823378: Cache image data objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git try Created 8 years, 4 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/tests/test_graphics_2d.cc ('k') | ppapi/thunk/ppb_graphics_2d_thunk.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/memory/ref_counted.h" 5 #include "base/memory/ref_counted.h"
6 #include "ppapi/c/pp_bool.h" 6 #include "ppapi/c/pp_bool.h"
7 #include "ppapi/c/pp_completion_callback.h" 7 #include "ppapi/c/pp_completion_callback.h"
8 #include "ppapi/c/pp_point.h" 8 #include "ppapi/c/pp_point.h"
9 #include "ppapi/c/pp_rect.h" 9 #include "ppapi/c/pp_rect.h"
10 #include "ppapi/c/pp_resource.h" 10 #include "ppapi/c/pp_resource.h"
11 #include "ppapi/c/pp_size.h" 11 #include "ppapi/c/pp_size.h"
12 12
13 namespace ppapi { 13 namespace ppapi {
14 14
15 class TrackedCallback; 15 class TrackedCallback;
16 16
17 namespace thunk { 17 namespace thunk {
18 18
19 class PPB_Graphics2D_API { 19 class PPB_Graphics2D_API {
20 public: 20 public:
21 virtual ~PPB_Graphics2D_API() {} 21 virtual ~PPB_Graphics2D_API() {}
22 22
23 virtual PP_Bool Describe(PP_Size* size, PP_Bool* is_always_opaque) = 0; 23 virtual PP_Bool Describe(PP_Size* size, PP_Bool* is_always_opaque) = 0;
24 virtual void PaintImageData(PP_Resource image_data, 24 virtual void PaintImageData(PP_Resource image_data,
25 const PP_Point* top_left, 25 const PP_Point* top_left,
26 const PP_Rect* src_rect) = 0; 26 const PP_Rect* src_rect) = 0;
27 virtual void Scroll(const PP_Rect* clip_rect, 27 virtual void Scroll(const PP_Rect* clip_rect,
28 const PP_Point* amount) = 0; 28 const PP_Point* amount) = 0;
29 virtual void ReplaceContents(PP_Resource image_data) = 0; 29 virtual void ReplaceContents(PP_Resource image_data) = 0;
30 virtual int32_t Flush(scoped_refptr<TrackedCallback> callback) = 0;
31 virtual bool SetScale(float scale) = 0; 30 virtual bool SetScale(float scale) = 0;
32 virtual float GetScale() = 0; 31 virtual float GetScale() = 0;
32
33 // When |old_image_data| is non-null and the flush is executing a replace
34 // contents (which leaves the "old" ImageData unowned), the resource ID of
35 // the old image data will be placed into |*old_image_data| synchronously
36 // (not when the flush callback completes).
37 //
38 // When this happens, a reference to this resource will be transferred to the
39 // caller. If there is no replace contents operation, old_image_data will be
40 // ignored. If |*old_image_data| is null, then the old image data will be
41 // destroyed if there was one.
42 virtual int32_t Flush(scoped_refptr<TrackedCallback> callback,
43 PP_Resource* old_image_data) = 0;
33 }; 44 };
34 45
35 } // namespace thunk 46 } // namespace thunk
36 } // namespace ppapi 47 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/tests/test_graphics_2d.cc ('k') | ppapi/thunk/ppb_graphics_2d_thunk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698