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

Side by Side Diff: services/ui/public/cpp/bitmap_uploader.cc

Issue 2232793002: services/ui: Move cc::SoftwareOutputDevice implementation into the client lib. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "services/ui/public/cpp/bitmap_uploader.h" 5 #include "services/ui/public/cpp/bitmap_uploader.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "cc/ipc/compositor_frame.mojom.h" 12 #include "cc/ipc/compositor_frame.mojom.h"
13 #include "cc/quads/render_pass.h" 13 #include "cc/quads/render_pass.h"
14 #include "cc/quads/solid_color_draw_quad.h" 14 #include "cc/quads/solid_color_draw_quad.h"
15 #include "cc/quads/texture_draw_quad.h" 15 #include "cc/quads/texture_draw_quad.h"
16 #include "services/ui/public/cpp/gles2_context.h" 16 #include "services/ui/public/cpp/gles2_context.h"
17 #include "services/ui/public/cpp/window.h" 17 #include "services/ui/public/cpp/window.h"
18 #include "services/ui/public/cpp/window_surface.h" 18 #include "services/ui/public/cpp/window_surface.h"
19 19
20 namespace ui { 20 namespace ui {
21 namespace { 21 namespace {
22 22
23 const uint32_t g_transparent_color = 0x00000000; 23 const uint32_t g_transparent_color = 0x00000000;
24 24
25 } // namespace 25 } // namespace
26 26
27 const char kBitmapUploaderForAcceleratedWidget[] =
28 "__BITMAP_UPLOADER_ACCELERATED_WIDGET__";
29
30 BitmapUploader::BitmapUploader(Window* window) 27 BitmapUploader::BitmapUploader(Window* window)
31 : window_(window), 28 : window_(window),
32 color_(g_transparent_color), 29 color_(g_transparent_color),
33 width_(0), 30 width_(0),
34 height_(0), 31 height_(0),
35 format_(BGRA), 32 format_(BGRA),
36 next_resource_id_(1u) {} 33 next_resource_id_(1u) {}
37 34
38 BitmapUploader::~BitmapUploader() { 35 BitmapUploader::~BitmapUploader() {
39 } 36 }
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 DCHECK_EQ(1, resource.count); 190 DCHECK_EQ(1, resource.count);
194 gl->WaitSyncTokenCHROMIUM(resource.sync_token.GetConstData()); 191 gl->WaitSyncTokenCHROMIUM(resource.sync_token.GetConstData());
195 uint32_t texture_id = resource_to_texture_id_map_[resource.id]; 192 uint32_t texture_id = resource_to_texture_id_map_[resource.id];
196 DCHECK_NE(0u, texture_id); 193 DCHECK_NE(0u, texture_id);
197 resource_to_texture_id_map_.erase(resource.id); 194 resource_to_texture_id_map_.erase(resource.id);
198 gl->DeleteTextures(1, &texture_id); 195 gl->DeleteTextures(1, &texture_id);
199 } 196 }
200 } 197 }
201 198
202 } // namespace ui 199 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698