summaryrefslogtreecommitdiffstats
path: root/mojo
diff options
context:
space:
mode:
Diffstat (limited to 'mojo')
-rw-r--r--mojo/examples/surfaces_app/child_impl.cc4
-rw-r--r--mojo/examples/surfaces_app/embedder.cc12
-rw-r--r--mojo/services/public/cpp/surfaces/lib/surfaces_type_converters.cc9
-rw-r--r--mojo/services/public/cpp/surfaces/tests/surface_unittest.cc15
4 files changed, 17 insertions, 23 deletions
diff --git a/mojo/examples/surfaces_app/child_impl.cc b/mojo/examples/surfaces_app/child_impl.cc
index 52118f0..2d5140a 100644
--- a/mojo/examples/surfaces_app/child_impl.cc
+++ b/mojo/examples/surfaces_app/child_impl.cc
@@ -85,14 +85,14 @@ void ChildImpl::Draw() {
CreateAndAppendSimpleSharedQuadState(pass.get(), gfx::Transform(), size_);
- scoped_ptr<SolidColorDrawQuad> color_quad = SolidColorDrawQuad::Create();
+ SolidColorDrawQuad* color_quad =
+ pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
bool force_anti_aliasing_off = false;
color_quad->SetNew(pass->shared_quad_state_list.back(),
rect,
rect,
color_,
force_anti_aliasing_off);
- pass->quad_list.push_back(color_quad.PassAs<DrawQuad>());
scoped_ptr<DelegatedFrameData> delegated_frame_data(new DelegatedFrameData);
delegated_frame_data->render_pass_list.push_back(pass.Pass());
diff --git a/mojo/examples/surfaces_app/embedder.cc b/mojo/examples/surfaces_app/embedder.cc
index a525a18..1a620d0 100644
--- a/mojo/examples/surfaces_app/embedder.cc
+++ b/mojo/examples/surfaces_app/embedder.cc
@@ -49,11 +49,11 @@ void Embedder::ProduceFrame(cc::SurfaceId child_one,
one_transform.Translate(-child_size.width() / 2, -child_size.height() / 2);
CreateAndAppendSimpleSharedQuadState(pass.get(), one_transform, size);
- scoped_ptr<SurfaceDrawQuad> surface_one_quad = SurfaceDrawQuad::Create();
+ SurfaceDrawQuad* surface_one_quad =
+ pass->CreateAndAppendDrawQuad<SurfaceDrawQuad>();
gfx::Rect one_rect(child_size);
surface_one_quad->SetNew(
pass->shared_quad_state_list.back(), one_rect, one_rect, child_one);
- pass->quad_list.push_back(surface_one_quad.PassAs<DrawQuad>());
gfx::Transform two_transform;
two_transform.Translate(10 + size.width() / 2 + child_size.width() / 2,
@@ -62,21 +62,21 @@ void Embedder::ProduceFrame(cc::SurfaceId child_one,
two_transform.Translate(-child_size.width() / 2, -child_size.height() / 2);
CreateAndAppendSimpleSharedQuadState(pass.get(), two_transform, size);
- scoped_ptr<SurfaceDrawQuad> surface_two_quad = SurfaceDrawQuad::Create();
+ SurfaceDrawQuad* surface_two_quad =
+ pass->CreateAndAppendDrawQuad<SurfaceDrawQuad>();
gfx::Rect two_rect(child_size);
surface_two_quad->SetNew(
pass->shared_quad_state_list.back(), two_rect, two_rect, child_two);
- pass->quad_list.push_back(surface_two_quad.PassAs<DrawQuad>());
CreateAndAppendSimpleSharedQuadState(pass.get(), gfx::Transform(), size);
- scoped_ptr<SolidColorDrawQuad> color_quad = SolidColorDrawQuad::Create();
+ SolidColorDrawQuad* color_quad =
+ pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
bool force_anti_aliasing_off = false;
color_quad->SetNew(pass->shared_quad_state_list.back(),
rect,
rect,
SK_ColorYELLOW,
force_anti_aliasing_off);
- pass->quad_list.push_back(color_quad.PassAs<DrawQuad>());
scoped_ptr<DelegatedFrameData> delegated_frame_data(new DelegatedFrameData);
delegated_frame_data->render_pass_list.push_back(pass.Pass());
diff --git a/mojo/services/public/cpp/surfaces/lib/surfaces_type_converters.cc b/mojo/services/public/cpp/surfaces/lib/surfaces_type_converters.cc
index e61ad94..16527f6 100644
--- a/mojo/services/public/cpp/surfaces/lib/surfaces_type_converters.cc
+++ b/mojo/services/public/cpp/surfaces/lib/surfaces_type_converters.cc
@@ -113,8 +113,7 @@ scoped_ptr<cc::DrawQuad> ConvertTo(const surfaces::QuadPtr& input,
cc::SharedQuadState* sqs) {
switch (input->material) {
case surfaces::SOLID_COLOR: {
- scoped_ptr<cc::SolidColorDrawQuad> color_quad =
- cc::SolidColorDrawQuad::Create();
+ scoped_ptr<cc::SolidColorDrawQuad> color_quad(new cc::SolidColorDrawQuad);
color_quad->SetAll(
sqs,
input->rect.To<gfx::Rect>(),
@@ -126,8 +125,7 @@ scoped_ptr<cc::DrawQuad> ConvertTo(const surfaces::QuadPtr& input,
return color_quad.PassAs<cc::DrawQuad>();
}
case surfaces::SURFACE_CONTENT: {
- scoped_ptr<cc::SurfaceDrawQuad> surface_quad =
- cc::SurfaceDrawQuad::Create();
+ scoped_ptr<cc::SurfaceDrawQuad> surface_quad(new cc::SurfaceDrawQuad);
surface_quad->SetAll(
sqs,
input->rect.To<gfx::Rect>(),
@@ -138,8 +136,7 @@ scoped_ptr<cc::DrawQuad> ConvertTo(const surfaces::QuadPtr& input,
return surface_quad.PassAs<cc::DrawQuad>();
}
case surfaces::TEXTURE_CONTENT: {
- scoped_ptr<cc::TextureDrawQuad> texture_quad =
- cc::TextureDrawQuad::Create();
+ scoped_ptr<cc::TextureDrawQuad> texture_quad(new cc::TextureDrawQuad);
surfaces::TextureQuadStatePtr& texture_quad_state =
input->texture_quad_state;
texture_quad->SetAll(
diff --git a/mojo/services/public/cpp/surfaces/tests/surface_unittest.cc b/mojo/services/public/cpp/surfaces/tests/surface_unittest.cc
index 9a39126..5c2f98f 100644
--- a/mojo/services/public/cpp/surfaces/tests/surface_unittest.cc
+++ b/mojo/services/public/cpp/surfaces/tests/surface_unittest.cc
@@ -56,8 +56,7 @@ class SurfaceLibQuadTest : public testing::Test {
};
TEST_F(SurfaceLibQuadTest, ColorQuad) {
- scoped_ptr<cc::SolidColorDrawQuad> color_quad =
- cc::SolidColorDrawQuad::Create();
+ scoped_ptr<cc::SolidColorDrawQuad> color_quad(new cc::SolidColorDrawQuad);
SkColor arbitrary_color = SK_ColorGREEN;
bool force_anti_aliasing_off = true;
color_quad->SetAll(sqs.get(),
@@ -97,7 +96,7 @@ TEST_F(SurfaceLibQuadTest, ColorQuad) {
}
TEST_F(SurfaceLibQuadTest, SurfaceQuad) {
- scoped_ptr<cc::SurfaceDrawQuad> surface_quad = cc::SurfaceDrawQuad::Create();
+ scoped_ptr<cc::SurfaceDrawQuad> surface_quad(new cc::SurfaceDrawQuad);
cc::SurfaceId arbitrary_id(5);
surface_quad->SetAll(
sqs.get(), rect, opaque_rect, visible_rect, needs_blending, arbitrary_id);
@@ -120,7 +119,7 @@ TEST_F(SurfaceLibQuadTest, SurfaceQuad) {
}
TEST_F(SurfaceLibQuadTest, TextureQuad) {
- scoped_ptr<cc::TextureDrawQuad> texture_quad = cc::TextureDrawQuad::Create();
+ scoped_ptr<cc::TextureDrawQuad> texture_quad(new cc::TextureDrawQuad);
unsigned resource_id = 9;
bool premultiplied_alpha = true;
gfx::PointF uv_top_left(1.7f, 2.1f);
@@ -241,7 +240,7 @@ TEST_F(SurfaceLibQuadTest, RenderPass) {
float opacity = 0.65f;
int sorting_context_id = 13;
SkXfermode::Mode blend_mode = SkXfermode::kSrcOver_Mode;
- scoped_ptr<cc::SharedQuadState> sqs(new cc::SharedQuadState);
+ cc::SharedQuadState* sqs = pass->CreateAndAppendSharedQuadState();
sqs->SetAll(content_to_target_transform,
content_bounds,
visible_content_rect,
@@ -250,10 +249,9 @@ TEST_F(SurfaceLibQuadTest, RenderPass) {
opacity,
blend_mode,
sorting_context_id);
- pass->shared_quad_state_list.push_back(sqs.Pass());
- scoped_ptr<cc::SolidColorDrawQuad> color_quad =
- cc::SolidColorDrawQuad::Create();
+ cc::SolidColorDrawQuad* color_quad =
+ pass->CreateAndAppendDrawQuad<cc::SolidColorDrawQuad>();
SkColor arbitrary_color = SK_ColorGREEN;
bool force_anti_aliasing_off = true;
color_quad->SetAll(pass->shared_quad_state_list.back(),
@@ -263,7 +261,6 @@ TEST_F(SurfaceLibQuadTest, RenderPass) {
needs_blending,
arbitrary_color,
force_anti_aliasing_off);
- pass->quad_list.push_back(color_quad.PassAs<cc::DrawQuad>());
surfaces::PassPtr mojo_pass = surfaces::Pass::From(*pass);
ASSERT_FALSE(mojo_pass.is_null());