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

Side by Side Diff: ppapi/proxy/ppb_image_data_proxy.cc

Issue 11414171: Migrate Graphics2D to new design. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/proxy/ppb_image_data_proxy.h ('k') | ppapi/proxy/ppb_instance_proxy.h » ('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 "ppapi/proxy/ppb_image_data_proxy.h" 5 #include "ppapi/proxy/ppb_image_data_proxy.h"
6 6
7 #include <string.h> // For memcpy 7 #include <string.h> // For memcpy
8 8
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 } 395 }
396 396
397 SkCanvas* ImageData::GetCanvas() { 397 SkCanvas* ImageData::GetCanvas() {
398 #if defined(OS_NACL) 398 #if defined(OS_NACL)
399 return NULL; // No canvas in NaCl. 399 return NULL; // No canvas in NaCl.
400 #else 400 #else
401 return mapped_canvas_.get(); 401 return mapped_canvas_.get();
402 #endif 402 #endif
403 } 403 }
404 404
405 void ImageData::SetUsedInReplaceContents() {
406 used_in_replace_contents_ = true;
407 }
408
405 void ImageData::RecycleToPlugin(bool zero_contents) { 409 void ImageData::RecycleToPlugin(bool zero_contents) {
406 used_in_replace_contents_ = false; 410 used_in_replace_contents_ = false;
407 if (zero_contents) { 411 if (zero_contents) {
408 void* data = Map(); 412 void* data = Map();
409 memset(data, 0, desc_.stride * desc_.size.height); 413 memset(data, 0, desc_.stride * desc_.size.height);
410 Unmap(); 414 Unmap();
411 } 415 }
412 } 416 }
413 417
414 #if !defined(OS_NACL) 418 #if !defined(OS_NACL)
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 // still cached in our process, the proxy still holds a reference so we can 619 // still cached in our process, the proxy still holds a reference so we can
616 // remove the one the renderer just sent is. If the proxy no longer holds a 620 // remove the one the renderer just sent is. If the proxy no longer holds a
617 // reference, we released everything and we should also release the one the 621 // reference, we released everything and we should also release the one the
618 // renderer just sent us. 622 // renderer just sent us.
619 dispatcher()->Send(new PpapiHostMsg_PPBCore_ReleaseResource( 623 dispatcher()->Send(new PpapiHostMsg_PPBCore_ReleaseResource(
620 API_ID_PPB_CORE, old_image_data)); 624 API_ID_PPB_CORE, old_image_data));
621 } 625 }
622 626
623 } // namespace proxy 627 } // namespace proxy
624 } // namespace ppapi 628 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_image_data_proxy.h ('k') | ppapi/proxy/ppb_instance_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698