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

Side by Side Diff: webkit/plugins/ppapi/ppb_image_data_impl.cc

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 | « webkit/plugins/ppapi/ppb_image_data_impl.h ('k') | no next file » | 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 "webkit/plugins/ppapi/ppb_image_data_impl.h" 5 #include "webkit/plugins/ppapi/ppb_image_data_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 125 }
126 126
127 SkCanvas* PPB_ImageData_Impl::GetCanvas() { 127 SkCanvas* PPB_ImageData_Impl::GetCanvas() {
128 return backend_->GetCanvas(); 128 return backend_->GetCanvas();
129 } 129 }
130 130
131 const SkBitmap* PPB_ImageData_Impl::GetMappedBitmap() const { 131 const SkBitmap* PPB_ImageData_Impl::GetMappedBitmap() const {
132 return backend_->GetMappedBitmap(); 132 return backend_->GetMappedBitmap();
133 } 133 }
134 134
135 void PPB_ImageData_Impl::Swap(PPB_ImageData_Impl* other) {
136 backend_.swap(other->backend_);
137 std::swap(other->format_, format_);
138 std::swap(other->width_, width_);
139 std::swap(other->height_, height_);
140 }
141
142 // ImageDataPlatformBackend -------------------------------------------------- 135 // ImageDataPlatformBackend --------------------------------------------------
143 136
144 ImageDataPlatformBackend::ImageDataPlatformBackend() { 137 ImageDataPlatformBackend::ImageDataPlatformBackend() {
145 } 138 }
146 139
147 ImageDataPlatformBackend::~ImageDataPlatformBackend() { 140 ImageDataPlatformBackend::~ImageDataPlatformBackend() {
148 } 141 }
149 142
150 bool ImageDataPlatformBackend::Init(PPB_ImageData_Impl* impl, 143 bool ImageDataPlatformBackend::Init(PPB_ImageData_Impl* impl,
151 PP_ImageDataFormat format, 144 PP_ImageDataFormat format,
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 279
287 const SkBitmap* ImageDataNaClBackend::GetMappedBitmap() const { 280 const SkBitmap* ImageDataNaClBackend::GetMappedBitmap() const {
288 if (!IsMapped()) 281 if (!IsMapped())
289 return NULL; 282 return NULL;
290 return &skia_bitmap_; 283 return &skia_bitmap_;
291 } 284 }
292 285
293 } // namespace ppapi 286 } // namespace ppapi
294 } // namespace webkit 287 } // namespace webkit
295 288
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/ppb_image_data_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698