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

Side by Side Diff: gpu/command_buffer/service/gpu_processor_linux.cc

Issue 525022: Revert 35509 - linux: implement gpu plugin... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 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
OLDNEW
(Empty)
1 // Copyright (c) 2009 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 <gdk/gdkx.h>
6 #include "gpu/command_buffer/service/gpu_processor.h"
7 #include "gpu/command_buffer/service/x_utils.h"
8
9 using ::base::SharedMemory;
10
11 namespace gpu {
12
13 bool GPUProcessor::Initialize(gfx::PluginWindowHandle handle) {
14 DCHECK(handle);
15
16 // Cannot reinitialize.
17 if (decoder_->window() != NULL)
18 return false;
19
20 // Map the ring buffer and create the parser.
21 Buffer ring_buffer = command_buffer_->GetRingBuffer();
22 if (ring_buffer.ptr) {
23 parser_.reset(new CommandParser(ring_buffer.ptr,
24 ring_buffer.size,
25 0,
26 ring_buffer.size,
27 0,
28 decoder_.get()));
29 } else {
30 parser_.reset(new CommandParser(NULL, 0, 0, 0, 0,
31 decoder_.get()));
32 }
33
34 // Initialize GAPI immediately if the window handle is valid.
35 XWindowWrapper *window = new XWindowWrapper(GDK_DISPLAY(), handle);
36 decoder_->set_window_wrapper(window);
37 return decoder_->Initialize();
38 }
39
40 void GPUProcessor::Destroy() {
41 // Destroy GAPI if window handle has not already become invalid.
42 XWindowWrapper *window = decoder_->window();
43 if (window) {
44 decoder_->Destroy();
45 decoder_->set_window_wrapper(NULL);
46 delete window;
47 }
48 }
49
50 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gpu_processor.cc ('k') | gpu/command_buffer/service/gpu_processor_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698