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

Side by Side Diff: ui/gl/gl_image_ref_counted_memory.cc

Issue 331723003: gpu: Remove Create/DeleteImage IPC by adding an X11_PIXMAP_BUFFER GpuMemoryBuffer type. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: wip Created 6 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
OLDNEW
(Empty)
1 // Copyright 2014 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 "ui/gl/gl_image_ref_counted_memory.h"
6
7 #include "base/memory/ref_counted_memory.h"
8
9 namespace gfx {
10
11 GLImageRefCountedMemory::GLImageRefCountedMemory(const gfx::Size& size,
12 unsigned internalformat)
13 : GLImageMemory(size, internalformat) {
14 }
15
16 GLImageRefCountedMemory::~GLImageRefCountedMemory() {
17 Destroy();
18 }
19
20 bool GLImageRefCountedMemory::Initialize(
21 base::RefCountedMemory* ref_counted_memory) {
22 if (!HasValidFormat())
23 return false;
24
25 DCHECK(!ref_counted_memory_);
26 ref_counted_memory_ = ref_counted_memory;
27 GLImageMemory::Initialize(ref_counted_memory_->front());
28 return true;
29 }
30
31 void GLImageRefCountedMemory::Destroy() {
32 GLImageMemory::Destroy();
33 ref_counted_memory_ = NULL;
34 }
35
36 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698