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

Side by Side Diff: ui/ozone/platform/caca/caca_window_manager.cc

Issue 1050923003: zero-copy: Clarify to allocate/destroy GpuMemoryBuffer on any thread and use it on the main thread o (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: just add thread check Created 5 years, 8 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 "ui/ozone/platform/caca/caca_window_manager.h" 5 #include "ui/ozone/platform/caca/caca_window_manager.h"
6 6
7 #include "base/trace_event/trace_event.h" 7 #include "base/trace_event/trace_event.h"
8 #include "third_party/skia/include/core/SkCanvas.h" 8 #include "third_party/skia/include/core/SkCanvas.h"
9 #include "third_party/skia/include/core/SkSurface.h" 9 #include "third_party/skia/include/core/SkSurface.h"
10 #include "ui/gfx/skia_util.h" 10 #include "ui/gfx/skia_util.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 int32_t CacaWindowManager::AddWindow(CacaWindow* window) { 111 int32_t CacaWindowManager::AddWindow(CacaWindow* window) {
112 return windows_.Add(window); 112 return windows_.Add(window);
113 } 113 }
114 114
115 void CacaWindowManager::RemoveWindow(int window_id, CacaWindow* window) { 115 void CacaWindowManager::RemoveWindow(int window_id, CacaWindow* window) {
116 DCHECK_EQ(window, windows_.Lookup(window_id)); 116 DCHECK_EQ(window, windows_.Lookup(window_id));
117 windows_.Remove(window_id); 117 windows_.Remove(window_id);
118 } 118 }
119 119
120 CacaWindowManager::~CacaWindowManager() { 120 CacaWindowManager::~CacaWindowManager() {
121 DCHECK(thread_checker_.CalledOnValidThread());
reveman 2015/04/07 13:07:05 how are the DCHECKs in this file related to GpuMem
121 } 122 }
122 123
123 bool CacaWindowManager::LoadEGLGLES2Bindings( 124 bool CacaWindowManager::LoadEGLGLES2Bindings(
124 AddGLLibraryCallback add_gl_library, 125 AddGLLibraryCallback add_gl_library,
125 SetGLGetProcAddressProcCallback set_gl_get_proc_address) { 126 SetGLGetProcAddressProcCallback set_gl_get_proc_address) {
127 DCHECK(thread_checker_.CalledOnValidThread());
126 return false; 128 return false;
127 } 129 }
128 130
129 scoped_ptr<ui::SurfaceOzoneCanvas> CacaWindowManager::CreateCanvasForWidget( 131 scoped_ptr<ui::SurfaceOzoneCanvas> CacaWindowManager::CreateCanvasForWidget(
130 gfx::AcceleratedWidget widget) { 132 gfx::AcceleratedWidget widget) {
133 DCHECK(thread_checker_.CalledOnValidThread());
131 CacaWindow* window = windows_.Lookup(widget); 134 CacaWindow* window = windows_.Lookup(widget);
132 DCHECK(window); 135 DCHECK(window);
133 136
134 scoped_ptr<CacaSurface> canvas(new CacaSurface(window)); 137 scoped_ptr<CacaSurface> canvas(new CacaSurface(window));
135 bool initialized = canvas->Initialize(); 138 bool initialized = canvas->Initialize();
136 DCHECK(initialized); 139 DCHECK(initialized);
137 return canvas.Pass(); 140 return canvas.Pass();
138 } 141 }
139 142
140 } // namespace ui 143 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698