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: components/bitmap_uploader/bitmap_uploader.cc

Issue 2080383002: cc/ipc: Move CompositorFrame mojoms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated owners Created 4 years, 6 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 "components/bitmap_uploader/bitmap_uploader.h" 5 #include "components/bitmap_uploader/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 "components/mus/public/cpp/gles2_context.h" 13 #include "components/mus/public/cpp/gles2_context.h"
13 #include "components/mus/public/cpp/surfaces/surfaces_type_converters.h" 14 #include "components/mus/public/cpp/surfaces/surfaces_type_converters.h"
14 #include "components/mus/public/cpp/surfaces/surfaces_utils.h" 15 #include "components/mus/public/cpp/surfaces/surfaces_utils.h"
15 #include "components/mus/public/cpp/window.h" 16 #include "components/mus/public/cpp/window.h"
16 #include "components/mus/public/cpp/window_surface.h" 17 #include "components/mus/public/cpp/window_surface.h"
17 18
18 namespace bitmap_uploader { 19 namespace bitmap_uploader {
19 namespace { 20 namespace {
20 21
21 const uint32_t g_transparent_color = 0x00000000; 22 const uint32_t g_transparent_color = 0x00000000;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 height_ = height; 66 height_ = height;
66 bitmap_ = std::move(data); 67 bitmap_ = std::move(data);
67 format_ = format; 68 format_ = format;
68 if (surface_) 69 if (surface_)
69 Upload(); 70 Upload();
70 } 71 }
71 72
72 void BitmapUploader::Upload() { 73 void BitmapUploader::Upload() {
73 const gfx::Rect bounds(window_->bounds()); 74 const gfx::Rect bounds(window_->bounds());
74 cc::mojom::RenderPassPtr pass = mojo::CreateDefaultPass(1, bounds); 75 cc::mojom::RenderPassPtr pass = mojo::CreateDefaultPass(1, bounds);
75 mus::mojom::CompositorFramePtr frame = mus::mojom::CompositorFrame::New(); 76 cc::mojom::CompositorFramePtr frame = cc::mojom::CompositorFrame::New();
76 77
77 // TODO(rjkroege): Support device scale factor in PDF viewer 78 // TODO(rjkroege): Support device scale factor in PDF viewer
78 frame->metadata.device_scale_factor = 1.0f; 79 frame->metadata.device_scale_factor = 1.0f;
79 80
80 frame->resources.resize(0u); 81 frame->resources.resize(0u);
81 82
82 pass->quads.resize(0u); 83 pass->quads.resize(0u);
83 // The SharedQuadState is owned by the SharedQuadStateList shared_quad_states. 84 // The SharedQuadState is owned by the SharedQuadStateList shared_quad_states.
84 cc::SharedQuadState* sqs = 85 cc::SharedQuadState* sqs =
85 pass->shared_quad_states.AllocateAndConstruct<cc::SharedQuadState>(); 86 pass->shared_quad_states.AllocateAndConstruct<cc::SharedQuadState>();
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 DCHECK_EQ(1, resource.count); 207 DCHECK_EQ(1, resource.count);
207 gl->WaitSyncTokenCHROMIUM(resource.sync_token.GetConstData()); 208 gl->WaitSyncTokenCHROMIUM(resource.sync_token.GetConstData());
208 uint32_t texture_id = resource_to_texture_id_map_[resource.id]; 209 uint32_t texture_id = resource_to_texture_id_map_[resource.id];
209 DCHECK_NE(0u, texture_id); 210 DCHECK_NE(0u, texture_id);
210 resource_to_texture_id_map_.erase(resource.id); 211 resource_to_texture_id_map_.erase(resource.id);
211 gl->DeleteTextures(1, &texture_id); 212 gl->DeleteTextures(1, &texture_id);
212 } 213 }
213 } 214 }
214 215
215 } // namespace bitmap_uploader 216 } // namespace bitmap_uploader
OLDNEW
« no previous file with comments | « components/bitmap_uploader/bitmap_uploader.h ('k') | components/mus/gpu/display_compositor/compositor_frame_sink_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698