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

Side by Side Diff: cc/resources/etc1_pixel_ref.cc

Issue 138393002: replace etc1_pixel_ref with skia version (SkMallocPixelRef) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | « cc/resources/etc1_pixel_ref.h ('k') | cc/resources/ui_resource_bitmap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "cc/resources/etc1_pixel_ref.h"
6
7 #include "base/memory/scoped_ptr.h"
8 #include "third_party/skia/include/core/SkPixelRef.h"
9
10 namespace cc {
11
12 // Takes ownership of pixels.
13 ETC1PixelRef::ETC1PixelRef(const SkImageInfo& info,
14 size_t rowBytes,
15 scoped_ptr<uint8_t[]> pixels)
16 : SkPixelRef(info), rowBytes_(rowBytes), pixels_(pixels.Pass()) {
17 setImmutable();
18 }
19
20 ETC1PixelRef::~ETC1PixelRef() {}
21
22 #ifdef SK_SUPPORT_LEGACY_ONLOCKPIXELS
23 void* ETC1PixelRef::onLockPixels(SkColorTable** color_table) {
24 *color_table = NULL;
25 return static_cast<void*>(pixels_.get());
26 }
27 #endif
28
29 bool ETC1PixelRef::onNewLockPixels(LockRec* rec) {
30 if (pixels_.get()) {
31 rec->fPixels = pixels_.get();
32 rec->fColorTable = NULL;
33 rec->fRowBytes = rowBytes_;
34 return true;
35 }
36 return false;
37 }
38
39 void ETC1PixelRef::onUnlockPixels() {}
40
41 SkFlattenable::Factory ETC1PixelRef::getFactory() const { return NULL; }
42
43 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/etc1_pixel_ref.h ('k') | cc/resources/ui_resource_bitmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698